spite / THREE.MeshLine

Mesh replacement for THREE.Line
MIT License
2.14k stars 381 forks source link

How to draw a curve on a sphere #41

Closed lishaobobo closed 7 years ago

lishaobobo commented 7 years ago

How to draw a curve on a sphere,thank you!

makc commented 7 years ago

Shouldn't you be able to draw a curve on anything by copy-pasting from this?

lishaobobo commented 7 years ago

@makc now I know the beginning and the end and radius,but I can't control the direction of meshLine

spite commented 7 years ago

You have to build the array of vertices that define your curve. You can google how to create arcs: you need to turn your start and end points into spherical coordinates, and interpolate from one to the other, turning each interpolated point back to cartesian and add it to the MeshLine vertex array,

lishaobobo commented 7 years ago

@spite I've already solved it. Thank you!

spite commented 7 years ago

Great to know! How did you end up doing it?

lishaobobo commented 7 years ago

@spite As you say, first know the starting point, then use the ball coordinates, the most important time line radian