Jump to content
  • Advertisement
Sign in to follow this  
David Hart

Finding out Mesh Primitive-Type

This topic is 4614 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I would like to play around with the polygons in a DirectX Mesh object. I can lock the index and vertex buffer, but I can't figure out what the primitive type is. Without that information, there is no way I can differenciate one polygon from another. Any clues? Edit: I guess I could do something of the sort: if (mesh.FaceCount * 3 = mesh.VertexCount) // Triangle list else if (mesh.FaceCount + 2 = mesh.VertexCount) // Triangle strip else // Something else... But some objects are defined with multiple triangle strips. How about the different subsets? Can the primitive type change? Without a clear understanding of how the Mesh class organises it's vertices I can't go very far. [Edited by - David Hart on March 28, 2006 1:50:43 PM]

Share this post


Link to post
Share on other sites
Advertisement

From DirectX SDK :
"D3DX Meshes use indexed triangle lists, and are therefore drawn with IDirect3DDevice9::DrawIndexedPrimitive."

So, based on SDK text, it will use strips only if :
1) You have done the strip optimizations for it.
2) Used DX Optimize functions for it.

If you haven't done any of these, it is using indexed triangle lists.

Share this post


Link to post
Share on other sites
Thx! I'll try this out. Something from the DirectX SDK seems wrong though:

DirectX SDK:
"Only an indexed mesh uses the index buffer. If a mesh is made up of a triangle list, for example, it does not use the index buffer."

Isn't it the other way round? Only triangle lists use the index buffer, right?

Share this post


Link to post
Share on other sites
SDK text means that only indexed meshes use IndexBuffer, nonindexed doesn't. It just helps to realize what indexed means. You can have triangle lists or strips but they don't have to use index buffer. :P

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!