0

I'm interested in drawing flight path style curves on a potentially fake sphere in Android. My goal is to show glowing bezier curves radiating out from a single point on the featureless sphere to different locations (potentially on the other side from the viewer's perspective).

What is a good approach to do this? I was thinking that it might be possible to set up a graphics Camera and do some fancy rotations that I can apply to a 2D path in order to draw them on top of a statically rendered sphere, but I'm afraid about how to clip the curves when they go behind the static sphere (/circle), not to mention the ability to draw some depth. It seems like this is actually a non-trivial task with the available APIs (and my failure to remember most of my linear algebra).

JustinHK
  • 758
  • 1
  • 6
  • 19
  • The flight path page already provides most of the math needed, apart from drawing a 3D bezier curve. A quick search yields [this post](https://stackoverflow.com/questions/10918715/math-opengl-es-draw-3d-bezier-curve-of-varying-width). – meowgoesthedog Feb 27 '18 at 12:25
  • I don't really want to render the globe with triangles, though, so it seems like there is a complicated clipping problem to solve? And can I draw a 2D curve with the canvas, or do I need to use OpenGL ES? They won't be moving around, just fading. – JustinHK Feb 27 '18 at 14:09
  • I wasn't talking about the globe - those links are for drawing the *curves*. Disadvantages of drawing with a canvas: 1) slow (done by software), 2) any part of the curve hidden by the globe will still show (unless you do some clipping math which is overkill), and 3) The result will not be perspective correct. – meowgoesthedog Feb 27 '18 at 14:14
  • My point was that it seemed potentially easier to draw with on the canvas since I could ignore the globe and draw a circle (except, as you point out, there is a clipping problem). So it sounds like the best approach is OpenGL and raw math? – JustinHK Feb 27 '18 at 19:51

0 Answers0