Sign in to follow this  

VertexDeclaraction from loaded mesh

This topic is 4306 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 need to know the struct of the vertices in a loaded mesh. (C#) The Mesh.VertexFormat give me the flags. Are there any way to get some more friendly information like the VertexDeclaraction which give me all the elements that shape the vertex, their usages, and position in the vertex structure. So I could know that the normals start in the 4th byte of the vertex data and is a float3. I guess that I could use the build-in Vertex Structures according to the vertex format, but looks like a lot of "switch() case" to handle all of them.

Share this post


Link to post
Share on other sites
Well, in the native D3DX, ID3DXMesh has both GetFVF() and GetDeclaration() - so I would look into it a little more. Vertex decls make it easy to do this kind of thing.

Also, here is a tidbit of source that will break-down FVF's for you.

Share this post


Link to post
Share on other sites
The property you are looking for is “Declaration“. Additional you can always get the vertex elements from a vertex format with “VertexInformation.DeclaratorFromFormat“.

Share this post


Link to post
Share on other sites

This topic is 4306 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this