PDA

View Full Version : Mesh creation of 2D areas



pospisil_m
01-24-2003, 12:49 AM
Could you advice me some articles and sample codes about mesh creation of 2D areas ?

Thanks,
Martin

Relic
01-24-2003, 02:44 AM
I have this great link in my favorites: http://www.cs.berkeley.edu/~jrs/meshf99/

Or do a search on "Delauny triangulation".
I found a lot of others while searching for "Implicit Surfaces".

JustHanging
01-25-2003, 02:46 AM
Or maybe all you need are the glu tesselators? Just search for them, there's a lot of information on those in the web.

-Ilkka

pospisil_m
01-26-2003, 09:41 PM
Originally posted by JustHanging:
Or maybe all you need are the glu tesselators? Just search for them, there's a lot of information on those in the web.

-Ilkka

Thanks, I'm not expert in GLU librabrary but I'll need this mesh not only for graphics purpose... I will do some engineering calculation... Is it possible?

Martin

JustHanging
01-26-2003, 11:00 PM
Yeah, it's possible. The way these tesselators work is, you give them the contours of the area, and the tesselator outputs the tesselated version through three callbacks, begin, end and vertex.

Normally these callbacks would be directed to glBegin, glEnd and glVertex, but you can replace them with your own routines that gather the triangles into memory. The trick is, that the tesselators recreate the area as a combination of triangles, triangle strips and triangle fans. So you'll have to write your own tiny state machine which simulates the way OpenGL produces triangles from these.

Another option is to let OpenGL just draw them and use feedback mode to get the triangulation. This method comes with it's own set of problems, so I'd go with custom callbacks if I was you.

-Ilkka