Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!crdgw1!millerjv From: millerjv@rigel.crd.ge.com (Jim V Miller) Newsgroups: comp.graphics Subject: Re: Triangulating non-planar surfaces Message-ID: Date: 25 Jul 90 12:41:33 GMT References: <6067@aplcen.apl.jhu.edu> Sender: news@crdgw1.crd.ge.com Reply-To: (Jimmy Miller) Followup-To: comp.graphics Organization: GE Corporate Research & Development Lines: 62 In-reply-to: randy@aplcomm.jhuapl.edu's message of 24 Jul 90 20:39:35 GMT 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."