2

What's the best way to draw part of sphere in, for example, OpenGL, considering I have vertices of boundaries of region that should be rendered?

I'm drawing sphere using octahedron transformation (described here: https://stackoverflow.com/a/7687312/1840136) and I can draw arcs that represent boundaries in same way by creating intermediate vertices and then "normalizing" them.

To create triangles out of plane I can use something from this answer: https://math.stackexchange.com/a/1814637, but thing is it will be still flat something. To get part of sphere, I definitely need another bunch of intermediate vertices for additional triangles. What is the algorithms for such task? And, as I already may have triangles forming original sphere, can I use this data somehow?

Bohdan Ivanov
  • 806
  • 9
  • 28
  • So [constructive solid geometry (CSG)](https://en.wikipedia.org/wiki/Constructive_solid_geometry)? Take your sphere geometry 'intersect' it with the clipping volume. – genpfault Aug 29 '19 at 15:02
  • Looks like overkill in my case. My goal to display some kind of a map on globe (like GMaps/Planet Earth or Paradox games), so I will need to calculate parts for every region I'll define. Will CSG be efficient here? – Bohdan Ivanov Aug 29 '19 at 15:16
  • If the regions are not too large, you can triangulate them and project onto the sphere. Unless you want to use them as decals (where you want the triangulation to match the underlying one). – Nico Schertler Aug 29 '19 at 15:51
  • Yes, actually, that's what I'm going to do in the end :) Question is what's the best way to perform triangulation. Is Delaunay triangulation good one for my purpose? – Bohdan Ivanov Aug 29 '19 at 16:00

0 Answers0