Skip to main content
gamedev.net
🔒 Locked

.x files

Started by Ksingh30 3 replies 750+ views
Original Post
Ksingh30
Ksingh30
is it possible to have multiple objects in 1 .x file?
sirob
sirob
yes.

[edit] I was going to leave it at that, but if you want something more than a one word answer, you're going to have to be more specific. Sorry, I can't help you any more than that.
Sirob Yes.» - status: Work-O-Rama.
cNoob
cNoob
I think what Ksingh30 means is, is it possible to say have a gun and an enemy in one *.x file then once loaded is itpossible to sepperate them and use them as seperate objects. I dont know the answer im just explaining what i think Ksingh30 is asking.
Toni Petrina
Toni Petrina
Yes iti is possible. Different frames may have different meshes. The catch is that you don't use D3DXLoadMeshFromX to load mesh. You can either use D3DXLoadMeshHierarchyFromX or parse file yourself like in documentation sample.

Or you can always parse it youself.

The reason for this is that D3DXLoadMeshFromX will concantenate all meshes in file in one mesh. If you, however, decide to load frame hierarchy yourself, you can get all meshes individually in tree like structure
So... Muira Yoshimoto sliced off his head, walked 8 miles, and defeated a Mongolian horde... by beating them with his head?

Documentation? "We are writing games, we don't have to document anything".
ReaVeR-Andrey
ReaVeR-Andrey
There's a good book called Anvanced Animation With DirectX (Amazon). It has a lot of code and explanations on this.

The code for loading multiple objects is quite large. I've made an example of it, but documentation would help better.

The thing is you can create your own template and store custom data in X file.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.