|
-
Feb 23rd, 2003, 01:59 PM
#1
Thread Starter
New Member
loading .X files into a 3D World and giving them coordinates
I have created a 3D world that you can walk around in using the keyboard. Everything in the world so far I have had to create by entering vertices. I've made some .X files that I would like to load into the world but I cannot figure out how. I've downloaded .X file viewers and my files load in those so I know that the files are okay. I looked in the DirectX 8.0 SDK and read the tutorial on how to load .X files but it didn't work for me. I also need to learn how to give the .X files coordinates in the 3D world. One way I've seen is in the book "Windows Game Programming with Visual Basic and DirectX" where the meshes are moved to coordinates by matrix translations. If anyone could help me with these problems, please do. I can send you my code if needed. Thanks in advance!
Simbro
-
Feb 24th, 2003, 08:48 PM
#2
Hyperactive Member
Are talking about Binary X files or Text X files? I can help you out with the Text X files....however, if you're using DX, then RIP
-
Feb 24th, 2003, 08:53 PM
#3
Thread Starter
New Member
what's the difference? I created the files in MilkShape and exported them as DirectX Files.
-
Feb 24th, 2003, 09:15 PM
#4
Hyperactive Member
Open the X-File in Notepad.
If you see ASCII characters (especially ";" marks) and in the first lines the characters "txt" appear, then you are using Text X-Files
If you just see jiberish, than you are using Binary X-Files.
-
Feb 24th, 2003, 09:20 PM
#5
Thread Starter
New Member
here's the beginning of one of the .X files:
xof 0303txt 0032
template XSkinMeshHeader {
<3cf169ce-ff7c-44ab-93c0-f78f62d172e2>
WORD nMaxSkinWeightsPerVertex;
WORD nMaxSkinWeightsPerFace;
WORD nBones;
}
template VertexDuplicationIndices {
<b8d65549-d7c9-4995-89cf-53a9a8b031e3>
DWORD nIndices;
DWORD nOriginalVertices;
array DWORD indices[nIndices];
}
template SkinWeights {
<6f0d123b-bad2-4167-a0d0-80224f25fabb>
STRING transformNodeName;
DWORD nWeights;
array DWORD vertexIndices[nWeights];
array FLOAT weights[nWeights];
Matrix4x4 matrixOffset;
}
does this help?
-
Feb 24th, 2003, 09:42 PM
#6
Hyperactive Member
Yes....now...are you using DX or OpenGL? Or something else...btw...you are using a text X-File
-
Feb 24th, 2003, 09:44 PM
#7
Thread Starter
New Member
-
Feb 25th, 2003, 04:20 PM
#8
Fanatic Member
Look for "D3DXLoadMeshFromX" in the DX SDK.
-
Feb 25th, 2003, 04:51 PM
#9
Thread Starter
New Member
I did look in the SDK for "D3DXLoadMeshFromX". I also took the tutorial on loading .X files. I always got a subscript error. I think there is a problem with loading the textures if there is more than one.
BTW...I like your gates joke, lol
-
Feb 27th, 2003, 01:50 PM
#10
Member
Hey,
i had some problems loading x files too. But i have found the problem for me so maybe this works for you too.
The first problem is if your textures are .gif files, this didn't work at all, try to convert your textures to .jpg. then open the .x file with notepad and replace the texture references (for example i had to replace bubing_2.gif with wood 001.jpg). You can try this best with a very simple model. For example I started working with a chair, build up of 10 boxes (and therefore about 120 faces)
The next thing is to load the texture, use the createtexturefromfile() method and not the createtexturefromfileex() version.
I hope this helps you out.
Jordi
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|