Jump to content
  • Advertisement
Sign in to follow this  
Tispe

ID3DXMesh, members?

This topic is 2615 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 have been to msdn only to return more confused.

Basically as I understand it, a Mesh contains a set of vertex buffers, index buffers, textures and sometimes animantion keys. These are subsets.

Now, I wish to load a LPD3DXMESH object with the above mentioned informaton. I do not wish to use ...loadfromXfile. I wish to load from a costom file. Looking at the documentation for its members I only see methods...

What I am looking for is CreateSubset(insert v_buffer here, insert i_buffer here, insert texture here)

etc.

Do I need to tailor my own Mesh Class, or can you guys enlighten me on how ID3DXMesh actually works?

PS: A topology chart of ID3DXMesh would be much appreciated.

Share this post


Link to post
Share on other sites
Advertisement
From what I recall, a mesh uses only one vertex buffer. Subset information is stored somewhere else. Evidence? There only is one GetVertexBuffer-method, none for subsets. I really don't now how to set the subset-information (maybe there are many index buffers are something like that), but baiscally you could just load your custom file into a vertex buffer and asign that to the mesh, at least if you could go withput subsets. Maybe there is even a CresteMeshFromVertexBuffer-method or something like that?

Edit: You mentioned CreateSubset(vb, ib, texture).. A mesh doesn't store it's textures, you will have to load, store and set them manually every time you render a mesh..

Share this post


Link to post
Share on other sites
An ID3DXMesh contains a single vertex buffer and a single index buffer. You can use the D3DXCreateMesh() function to create a mesh with a specific number of vertices and indices, and then use LockVertexBuffer() and LockIndexBuffer() to lock and fill the VB and IB. You can useGetAttributeTable() to fill in the mesh's attribute table, which is used to render subsets.

But to be honest, you're probably better off creating your own mesh class.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!