How do I get total Vertices from a mesh????

Started by
8 comments, last by FireSoul 18 years, 8 months ago
Hi, i would like to know how to get the total number of vertices within a particular mesh. Is there a specific function for this or do i have to access the vertex info? Thanks.
Advertisement
D3DX mesh? If that is the case than there are functions for retrieving the number of vertices, faces, etc.
DWORD ID3DXMesh::GetNumVertices(void) is its name.

kp
------------------------------------------------------------Neo, the Matrix should be 16-byte aligned for better performance!
Hi the FireSoul,
Depending on if you use Managed DirectX or DirectX

[The Methods/Functions]
Native DirectX
ID3DXMesh::GetNumVertices Method : Retrieves the number of vertices in the mesh.
Managed DirectX
BaseMesh.NumberVertices Property : Retrieves the number of vertices in a mesh.

If you have any more questions please don't hestitate to ask.
Cheers!, i just thought it would be easier to ask here than to go searching for half an hour :).

Thanks again.

O yea, and its just normal direct x ( not managed).
Also, is there a method for getting the number of bytes per vertex?

Thanks again.
hi,

you don't need half an hour, just open the SDK docs at ID3DXMesh. I did this right now :)
GetFVF if probably what you need now.

kp
------------------------------------------------------------Neo, the Matrix should be 16-byte aligned for better performance!
hehe, im so bad at searching things. :( Thanks again.
Quote:Original post by FireSoul
is there a method for getting the number of bytes per vertex?

To complement what kovacsp said about ID3DXMesh::GetFVF() - you'll probably want to use D3DXGetFVFVertexSize() to decode the return value...

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

cheers!, I really hate searching, lol. Now thanks to you lot i can get on with my program :).

Thanks.

This topic is closed to new replies.

Advertisement