[comp.graphics] Triangulating non-planar surfaces

randy@aplcomm.jhuapl.edu (RANDALL SCHRICKEL (NCE) x7661) (07/25/90)

Actually, I know how to do that. What I really need to know is how to create
interior points for a non-planar surface that will let me triangulate it into
lots of little polygons, so the generated surface will look smooth.  My
specific application is a filled spinning globe. Currently I only show the
outlines of continents; I would like to fill them in. I CAN triangulate the
x,y,z of the outlines, but that's not enough. I need to introduce lots of
interior points to the outlines so that small triangles will be produced.
This is like a finite element analysis problem, but the FEA stuff I've seen
is only good for planar polygons. Is there a method for generating interior
points to a curved surface? Or do I compute the interior points in 2-D and
then do the triangulation in 3-D? Pointers to references, ideas, or code
(of course) would be most appreciated.
--
	Randy Schrickel randy@aplcomm.jhuapl.edu
	Johns Hopkins Applied Physics Lab
	Laurel, MD 20723
	"Life goes on, long after the thrill of living has gone."

millerjv@rigel.crd.ge.com (Jim V Miller) (07/25/90)

In article <6067@aplcen.apl.jhu.edu> randy@aplcomm.jhuapl.edu (RANDALL SCHRICKEL (NCE) x7661) writes:

   Actually, I know how to do that. What I really need to know is how to create
   interior points for a non-planar surface that will let me triangulate it into
   lots of little polygons, so the generated surface will look smooth.  My
   specific application is a filled spinning globe. Currently I only show the
   outlines of continents; I would like to fill them in. I CAN triangulate the
   x,y,z of the outlines, but that's not enough. I need to introduce lots of
   interior points to the outlines so that small triangles will be produced.

Since you know the surface that you are trying triangulate, can you triangulate
the x, y, z of the outlines of the continent, then start breaking these triangles
up into smaller ones (by splitting each edge into two), then "popping" then newly
created points on to the surface?  For instance if you have a face (triangle) like:


				/\
			       /  \
                              /    \
                             /      \
			    /        \
                            ----------

it can be subdivided into 4 triangles like:

				/\
			       /  \
			      /----\
			     / \  / \
                            /   \/   \
			    ----------

Continue subdividing down to the resolution that you believe will be "smooth" then
pop each of the added vertices onto the surface.  For a sphere, this is easy.
Just generate a vector from the center of the globe to a vertex.  Then set that
vertex's position to one on the globe that is also on that vector 
(vertex.x = Radius_X * vector.x; vertex.y = Radius_Y * vector.y ...).


If you want the surface to be composed of just triangles, then when you subdivide
one trianlge you must also subdivide its neighbors.  This can be done by either
subdividing the neighbors like above or like:

				/|\
			       / | \
			      /  |  \
			     /   |   \
                             ---------

This will maintain the integrity of your triangular mesh.  This method of subdivision
is actually from FEM automatic mesh generators.


Hope this helps.

--
Jimmy Miller

General Electric Corporate Research and Developement:	millerjv@crd.ge.com
Rensselaer Design Research Center (RPI):		jvmiller@rdrc.rpi.edu

"All I need is room to play."