|
-
Apr 7th, 2002, 06:31 AM
#1
Thread Starter
Member
Loading 3ds files into DirectX 8 as mesh
The main questing here is, how?
I can load .X (DirectX's native file), but I need to load 3DS, for greater processing speed. Also, a pointer to somewhere to learn to code my own mesh format would be very helpful. I can't find a tutorial anywhere on the net, it's all for C++.
And don't give the url for www.vbexplorer.com/directx4vb, as vbexplorer has run out of money, and has been disconnected, which means all sites it hosted (including directx4vb) are now down.
However, Jack Hoxely's tutorials (the guy at directx4vb) on www.gamedev.net are a seperate thing, and you can learn your DX there.
But for now, I need something slightly more complex.
Thanks.
On Error Give Up
Mind over matter. Then if it doesn't matter, you lose your mind.
-
Apr 7th, 2002, 09:41 AM
#2
Use the convs3ds program that is included with the SDK to convert your meshes over to the .x format. If you want to load straight from a 3ds format, you can try looking over on www.wotsit.org for athe file format description, or you can learn to read C++, and find a tutorial somewhere.
As to creating your own file format, it is very simple. Simply decide on a file format to follow, and do it. For instance, I use a format that follows this format:
Code:
typeID
numVertices
numIndices
numFaces
[vertices[0]..[numVertices-1]]
[indices[0]..[numIndices-1]]
Material
I simply parse whatever model format I convert from (ASE), and write in that format. On load, I just fill a vertex buffer and an index buffer, and draw as an indexed triangle list.
Z.
-
Apr 8th, 2002, 05:02 AM
#3
Thread Starter
Member
INFORMATION OVERLOAD!
I now know that the listing of vertices is in chunk 0x4100. That's great. How do I write the list of vertices into an array (assuming I know the number of vertices, which has to be read from elsewhere).
In fact, how do I read chunks?
On Error Give Up
Mind over matter. Then if it doesn't matter, you lose your mind.
-
Apr 8th, 2002, 08:08 AM
#4
Binary file mode, using the Get method.
Z.
-
Apr 9th, 2002, 07:26 AM
#5
Thread Starter
Member
- I figured that much. But what I'm really asking, is what does 0x4100 translate to in numbers. Is it binary? Oct? Not Hex I think.
On Error Give Up
Mind over matter. Then if it doesn't matter, you lose your mind.
-
Apr 10th, 2002, 06:48 AM
#6
Thread Starter
Member
ttt - I really need some help here.
On Error Give Up
Mind over matter. Then if it doesn't matter, you lose your mind.
-
Apr 10th, 2002, 08:14 AM
#7
A 0x prefix means its a hexidecimal number. You dont have to translate it at all. C++ will store 0x4100 correctly, and VB will store &h4100 correctly.
Z.
-
Apr 12th, 2002, 02:46 AM
#8
Thread Starter
Member
Thanks. Now I can load pot-plants and trees and stuff instead of cubes.
On Error Give Up
Mind over matter. Then if it doesn't matter, you lose your mind.
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
|