Skip to main content
GameDev.net gamedev.net
🔒 Locked

ID3DXMesh/BaseMesh Question

Started by dave Jun 22, 2010 at 4:06 PM 3 replies 1k views
Original Post
dave
dave
Racking my brains over this one, but there is probably a simple answer. When loading a .x file with D3DXLoadMeshFromX is there any way of determining (from that call of from the resulting mesh) whether the data is for a triangle strip or triangle list? DrawSubset() knows what its drawing so it must deduce it somehow.

The reason i need to know is because i am using D3DXIntersect and i want to know how i should be getting the vertices for the face that is intersected. in the past i have only wanted to know if the mesh was hit, not what part of it.

Thanks,
MJP
MJP
I had thought that ID3DXMesh only supported triangle lists. It certainly doesn't expose a primitive type anywhere...

I suppose one way you could tell would be by checking the number of faces, and seeing if it's equal to the number of indices * 2.
Evil Steve
Evil Steve
I also didn't think ID3DXMesh supported anything other than triangle lists.
dave
dave
There appears to be no way of getting the number of indices either, i had thought of that to MJP. However it does appear, as you say, that it only suppports triangle lists.

Cheers,
MJP
MJP
Quote:
Original post by Dave
There appears to be no way of getting the number of indices either


You can get the index buffer, and call GetDesc to retrieve the size in bytes.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.