Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

pickups

Multiple meshes in one X file

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

Hello. Is it possibile to load more then one mesh from an x file? I mean, assuming that i exported two boxes to an x file. Will they be saved as one mesh and there is nothing I can do about it, except maybe wrIting my own exporter? If so, it will be a pain exporting each mesh to a different file. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
The templates in .X files supports hierarchies. So having 2 meshes in a .X file is no problem. But how the 2 meshes are stored will depends on ur exporter. I believe most exporter that saves .X file should also save the hierarchy accordingly. You will have to test that out. An easy way is to give ur meshes unique names, export to ascii .X file, then do a search for the frames that contains the mesh names.


-Hun Yen Kwoon

Share this post


Link to post
Share on other sites
Ok, thanks. but when i load the x file, using D3DXCreateMeshFromFile, where is the reference to frames?

Share this post


Link to post
Share on other sites
quote:
Original post by pickups
Ok, thanks. but when i load the x file, using D3DXCreateMeshFromFile, where is the reference to frames?



Do u mean D3DXLoadMeshFromX ? There isn''t a D3DXCreateMeshFromFile.

You can''t use D3DXLoadMeshFromX simple because it was meant to load only a single mesh from a single .X file. The function will combined all the meshes, if there are more than 1 in the .X file, and output it as a single mesh. All hierarchy transformations will be collapsed to that single mesh.

If you wan to load multiple mesh with hierarchy information intact, you will need to parse the file yourself and check for the GUIDs of each frame.

For example TID_D3DRMMesh will be for mesh frames and ID_D3DRMFrameTransformMatrix will be for transformation frame. There are tons of other pre-defined templates, u will need to consult the D3D docs on that.



-Hun Yen Kwoon

Share this post


Link to post
Share on other sites
quote:
Original post by pickups
Thank you. ill look into it.


Or, you could go the simple route and use D3DXLoadMeshHierarchyFromX().

I like pie.

Share this post


Link to post
Share on other sites
quote:
Original post by RenderTarget
quote:
Original post by pickups
Thank you. ill look into it.


Or, you could go the simple route and use D3DXLoadMeshHierarchyFromX().

I like pie.


Yes! I''d totally forgotten about that function...
Thats definitely a much faster way.


-Hun Yen Kwoon

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!