Jump to content
  • Advertisement
Sign in to follow this  
EwanK

multiple meshes from same .x file

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

hey.. i have a "little" problem with my managed directx 3d game but first, id like to ask a question before clearing the point of the problem. what is the best way to create and use multiple meshes loaded from the same .x file? i have 16 objects in a 3d space that were first created from one .x file and then covered with an appropriate texture to distinguish from each other (the texture is not a part of the .x mesh). but when i try to check for an intersection to properly handle the object mouse picking, it doesnt work as expected. the 16 objects belong to 4 "players", meaning that each of the player has 4 of them. when i have a cycle thru the 4 objects of the first player (first in the meaning that it was created first) and check for the intersection, it doesnt work (altho the intersection algorithm itself is correct, as it worked flawlessly with only one loaded object). the intersection actually succeeds only for the very last object added to the game (the 16th one obviously), however the dump information states i clicked on the first object of the first player. the whole thing is described in more detail here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1216102&SiteID=1 im pretty desperate now :I id appreciate any help and/or tips.. thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
i did something similar to this recently. if your x file is non-animated, then each sub mesh is normally in a frame, you can extract each frame into a seperate mesh by reading them in seperately or saving them out into seperate x files using D3DXSaveMeshToFile.

Share this post


Link to post
Share on other sites
yeah that was one of the ideas i wanted to try, but its kinda non-pragmatic if you know what i mean.. saving the one .x file into 16 separate others and then loading each of them in the next cycle doesnt look like the right thing to do.
but i guess i should give it a try if there wont be any other solution :I
thanks tho.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!