Sign in to follow this  

split up ID3DXMesh

This topic is 3459 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

Im wondering if anyone has any techniques on splitting up an ID3DXMesh, such that i have one large scene in one ID3DXMesh, that i could split up into all the individual objects based on materials. so that i could create a file in 3ds max of 10 objects, and export as a single xxfile, and then load back into my game, but upon load up, split the one ID3DXMesh into multiple objects. has anyone done this?

Share this post


Link to post
Share on other sites
Just use different subsets of the mesh. Your exporter should be able to dice up the distinct objects into subsets in the .x file, but if not you can use DrawIndexedPrimitive and draw a certain range of vertices and transform each chunk in between your draw calls.

Share this post


Link to post
Share on other sites
Well, yes, but im wanting to divide the mesh into different objects so that i can build a collision box for each, and work with each separatly.

So i would prefer a vector or list of objects

Share this post


Link to post
Share on other sites
I've never done it but, if you really want to do it that way:

1. load the big mesh.
2. get the number of attributes.
3. create an empty mesh for each attribute.
4. get the attribute buffer for the big mesh.
5. go through the attribute buffer and, for each attribute, copy the vertices from the big mesh to the mesh for that attribute.
6. go through the vertex buffer for each attribute mesh and create your bounding box.

Share this post


Link to post
Share on other sites

This topic is 3459 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