PDA

View Full Version : Tesselation - rendering the contours of internal slices into a polygon



jenny
07-21-2002, 08:00 AM
I need help with Tesselation. I have several x y contours that each have an associated z coordinate. These coutours are made from the edge of an internal slice at the specified z-coordinate of the 3-D polygon I want to render, which could be concave. However, I belive that OpenGL needs a description of the faces of the object, instead of these "internal slice" contours. I haven't rendered my data yet, but I belive that the contour data would render as a series of 2-D polygons in stacked planes, instead of 1 3-D polygon. Am I right about this? How can I manipulate my contour data into data about the faces of this polygon, so that I can render it as a single 3-D object?

Thanks,
Jenny

mphanke
07-21-2002, 01:01 PM
Hi,

have a brief look at gluTesselate, I believe it is called so. This should do it, but is pretty simple to write an own solution for this problem. Just search for Tesselation on google. Or take a look at the other reply I posted to your most recent question.

Regards,

Martin

jenny
07-21-2002, 01:12 PM
I have looked at tesselation, though I'm not sure that it is the full solution to my problem. Wont tesselation just render the inside of my xy contour? What I need to do is create a 3-d object by joining multiple contours.

A web search has revelated that, since I have multiple xy contours of this object that are all parellel (made from internal slices of the object), I might need to "join" each adjacent xy contours by a sequence of triangle strips, to create a "ribbon" between each of the contours in order to render the full object. Key words are interpolation and triangulation. Is this the right direction?

Does tesselation do this?

Thanks,
Jenny

mphanke
07-21-2002, 03:33 PM
Hi,

well, tesselation describes the fitting of triangles on a given surface or between points. So from this point of view it is definetly the right way to go.
If I understand it right you have let's say a cylinder which is sliced e.g. 4 times. What you want to do is "reconstruct" the cylinder, right?
Then tesselation will solve the problem.

Greets,

Martin

P.S.: Where are you from?

JML
07-21-2002, 11:00 PM
A web search has revelated that, since I have multiple xy contours of this object that are all parellel (made from internal slices of the object), I might need to "join" each adjacent xy contours by a sequence of triangle strips, to create a "ribbon" between each of the contours in order to render the full object. Key words are interpolation and triangulation. Is this the right direction?

Yes.
I can imagine this can lead to 'difficult' algorithms when trying to create a 'best fit' for the triangle-strips. I have no idea how to solve it, but it is definitely the right direction.



Does tesselation do this?

No.
Tesselation will chop up a given (concave) polygon in multiple convex primitives. Tesselation does NOT join separate polygons together. In your case tesselation would result in multiple planar cross-sections of the original object.

Good luck.

Jean-Marc

harsman
07-22-2002, 12:52 AM
Provided that your contours have the same number of points and a consistent winding order of the vertices joining them with triangle strips should be simple. If they don't things get more complicated. If they do have these nice properties your code will turn out something like this:





glBegin(GL_TRIANGLE_STRIP);
for(int i=0; i<numContours-1; i++){
for(int j=0; i<numVertices; j++){
glVertex3fv(contours[i].vertices[j];
glVertex3fv(contours[i+1].vertices[j];
}
}
glEnd();



This doesn't supply normals, so you won't have lighting but thats easy enough to add.

jenny
07-22-2002, 09:41 AM
Unfortunately this is going to be a complicated reconstruction problem. There is no guarentee that the contours have the same number of points or even line up nicely, but I do think the contours will not be self intersecting. Anyone have any ideas for this more complicated case?

Thanks,
Jenny

[This message has been edited by jenny (edited 07-22-2002).]

Robbo
07-22-2002, 01:01 PM
I would research GIS systems if I were you. There are tricky problems involved in reconstructing surfaces when, for example you have two contours or `peaks' which have to eventually join into a single contour.

I seem to remember a paper in GEMS I about it.