Results 1 to 8 of 8

Thread: Loading 3ds files into DirectX 8 as mesh

  1. #1

    Thread Starter
    Member SapphireGreen's Avatar
    Join Date
    Sep 2001
    Location
    I do not actually exist
    Posts
    45

    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.

  2. #2
    Zaei
    Guest
    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.

  3. #3

    Thread Starter
    Member SapphireGreen's Avatar
    Join Date
    Sep 2001
    Location
    I do not actually exist
    Posts
    45
    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.

  4. #4
    Zaei
    Guest
    Binary file mode, using the Get method.

    Z.

  5. #5

    Thread Starter
    Member SapphireGreen's Avatar
    Join Date
    Sep 2001
    Location
    I do not actually exist
    Posts
    45
    - 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.

  6. #6

    Thread Starter
    Member SapphireGreen's Avatar
    Join Date
    Sep 2001
    Location
    I do not actually exist
    Posts
    45
    ttt - I really need some help here.
    On Error Give Up

    Mind over matter. Then if it doesn't matter, you lose your mind.

  7. #7
    Zaei
    Guest
    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.

  8. #8

    Thread Starter
    Member SapphireGreen's Avatar
    Join Date
    Sep 2001
    Location
    I do not actually exist
    Posts
    45
    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
  •  



Click Here to Expand Forum to Full Width