Sign in to follow this  

X file format parsing question: need help!

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

Hi everybody, I'm working on a X file loader that uses the ID3DXFile & ID3DXFileData helpers. I'm not using the D3DXMesh functions because I need to load these into my custom mesh class. I got everything working except the normals which I find to be akwardly defined in the MeshNormals template. For some reason, it defines the normals with a new set of faces and a set of normals which basically invalidates the positions/texcoords/color buffers I had loaded previously because all these other components use another, but common, index buffer (faces). Now I tried solving the problem: I "unindexed" my verts and the normals using their respective faces info and then I rebuilt a new common set of faces but that's slow as hell and I didn't get it to work perfectly yet. So, before I start going down the path of finalizing this solution and optimizing it for cache-coherency in the hope of speeding it up, my question is: is there something I'm missing? Looks like this is getting all very dumb but I don't see any other way! I wish there was a way to "merge" the faces without "unindexing" them. Thanks! [Edited by - bios10h on March 26, 2006 10:33:03 PM]

Share this post


Link to post
Share on other sites
I would use the D3DX function to load the mesh data (vertex and index buffers) and ID3DXFile to load any other stuff. Let DX figure out how to build those. You can always extract the data in those buffers from the ID3DXMesh interface. For my mesh modeler program I load everything using the D3DXLoadMeshHierarchyFromX function and then use ID3DXFile to load the animation data into my own classes.

However, I think you can ignore the face index data stored with the normals, and use the data stored with the mesh.

Share this post


Link to post
Share on other sites

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