Results 1 to 11 of 11

Thread: I need help with .x files!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Posts
    18

    Unhappy I need help with .x files!

    I need to be able to load and save their data, so... (PS I am using VB6, DX8)

    * I have found functions that I can use to get/set the raw vertex data from a D3DXMesh object, which is a start. However, this does not preserve the submesh information. How can I get/set this, or is it possible to do so?

    * If it isn't possible, then how could I read in a .x file myself in order to load up a 3d mesh into a custom class object that I would write for this? The mssdk reference material only helps to make this more confusing to me. In other words, how would I open up the .x file and parse the data?

    If the first one is possible, I would really prefer it, as it would be a lot easier for me.
    Note that once I have this data, I am writing it to my own binary resource file and then reading it in later. I can already handle the materials and the textures, so it is just the 3d data itself (and particularly the submesh data) I am worried about.

  2. #2
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    D3DXMesh.LockAttributeBuffer is the way to get that information. Have fun using it in VB, though.

    Z.

  3. #3
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Ah, I spoke too soon. D3DXBaseMesh.GetAttributeTable looks to be a little bit friendlier to you VBers .

    Z.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Posts
    18
    Well, that function seems that it should do exactly what I would want. However, when I tried it, I got back no data whatsoever - just a bunch of 0s. How does one use this function properly?

  5. #5
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    No idea. I use my own formats =).

    Z.

  6. #6
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    Zaei, have you done a 3ds to your format converter then?
    ICQ: 128716725

  7. #7
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    Originally posted by petrus
    Zaei, have you done a 3ds to your format converter then?
    ASE, at the moment, not 3ds.

    Z.

  8. #8
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    heh ok
    ICQ: 128716725

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Posts
    18
    Actually, it doesn't have to be .x files for me; any widely-accepted object format (*.dxf or *.obj for instance) would do. I was concentrating on .x files because DirectX has native support for them. Once I have the data, I will basically be using my own file format as I will simply be packing the pertinant data into my custom binary resource files. So could anyone point me in the direction of a tutorial or such that would explain how to load one of these such formats (preferably one that's relativly straightforward to understand)? Thanks a bunch.

  10. #10
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    It's even hard to find a tutorial about loading X-files..
    ICQ: 128716725

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Posts
    18
    Please? I'm really in a bind here! I can't continue with my game until I get this working!

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