Triangulation

Started by
3 comments, last by Gaming101 13 years, 9 months ago
I was just wondering what was the purpose of triangulation mesh data. What are the pros and cons of it.

I hear that you should triangulate because if speeds up rendering but I also read that's no longer the case with the newer versions of say DirectX. I also hear you shouldn't triangulate because if give you more polygons which would be bad for collision detection and other math operations.

So should I triangulate or not? Should I hold two data sets for the mesh data one for rendering another for math computations? Any help would be great.

Thanks
Advertisement
D3D only really supports three types of primitives - triangles, lines and points. That means for 3D rendering you'll want triangles. This is generally handled in the exporter used to get your 3D models into the game - you don't need to do it in your modelling software.

Physics libraries also tend to support triangles because that's the standard mesh format, but you probably don't want to use the same mesh representation for rendering as you do for physics anyway. A lower poly version is commonly used to speed things up.
So you use a high poly count model for rendering then a really low poly count for the physics? So you do use two sets?

Thanks for the reply
You can use two sets of geometry, or, if acceptable, narrow down the collision detection parametrically using bounding boxes and/or shapes like spheres, cylinders, capsules, etc., then apply a finer set of triangles - either a second set or the original mesh.

Depending on your collision algorithm, you may need two sets of data in any case - you may not be able to (or want to) render the collision set data directly if it needs to be in a vertex buffer, etc. It's a tradeoff. Locking and unlocking vertex buffers can be expensive timewise (e.g., they're in GPU memory) versus accessing data arranged to make collision detection easier - which takes more memory.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Big help thanks

This topic is closed to new replies.

Advertisement