Advertisement

Triangulation

Started by May 19, 2015 02:19 PM
12 comments, last by NDIR 9 years, 8 months ago

Any movement of vertices may cause connected triangles to flip around, so you'll have to check for that.

This would be the most efficient and robust solution, faster, easier, and no risk of edge cases causing problems compared to my previous suggestion of checking concave/convex transitions.

You only need to rebuild when any triangle changes winding order, which is extremely cheap to detect.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

BitMaster, what I meant was that I already know how to cut a polygon into triangles. The only part I don't know is whether I need to do it every time anything moves the slightest amount. But now it's starting to seem like that's the safest option.

But also, is there a way to cut it into triangles in 3D, without having to convert it to 2D first?

Advertisement

But also, is there a way to cut it into triangles in 3D, without having to convert it to 2D first?


The polygon is 2d, so there is no conversion. 2d is 3d already, just on a plane. You want to triangulate into a 3d mesh, but one axis will be zero because it is coplanar. For example, you can use (x,y) coordinates and keep z set to zero.

This mesh can then be transformed in 3d space using a 4x4 matrix. Or you can let a scenemanager do it for you. Either way, you will need to suppily a position and orientation you would like it to appear in 3d space.

How you generate and store your 3d mesh will depend on how it is being rendered.

For this exact problem (triangulating 3D polygons (with holes) on the random plane) i'm using the: gluTessBeginPolygon (and other gluTess* functions). It does the job beautifully.

This topic is closed to new replies.

Advertisement