Results 1 to 9 of 9

Thread: Direct3D8 Help...

  1. #1

    Thread Starter
    Addicted Member Virtual24's Avatar
    Join Date
    May 2001
    Posts
    228

    Question Direct3D8 Help...

    Does anyone know of any websites where I can find some good help with Drect3D8 around the lines of loading meshes from X-files and using them in various ways. Thanx.
    To protect time is to protect everything...

  2. #2
    Zaei
    Guest
    The Mesh tutorial (number 6, i believe) in the SDK has model loading code that you can use. From that point, it is very easy to use the meshes. Simply use basic transformation matrices to move, rotate and scale the mesh.

    Z.

  3. #3

    Thread Starter
    Addicted Member Virtual24's Avatar
    Join Date
    May 2001
    Posts
    228
    Yeah, i know about that... I am working with meshes that contain key freames (such as a person walking) and the tutorial doesn't give information about playing key frames. The sample 'skinnedmesh' in the SDK plays a mesh with key frames... but its really confusing...
    To protect time is to protect everything...

  4. #4
    Zaei
    Guest
    Yes, the skinned mesh sample is very confusing. Unfortunately, its the only reference VB programmers have. I would recommend that you print the entire sample, and then recreate it yourself.

    Z.

  5. #5
    Zaei
    Guest
    Oh, and you must be fairly familiar with recursion to even begin to understand how a skinned mesh works. The sample relies on it.

    Z.

  6. #6

    Thread Starter
    Addicted Member Virtual24's Avatar
    Join Date
    May 2001
    Posts
    228
    Hey, I have a new question: I have my model of a person in 3ds max and i used conv3ds to convert it to the .x format. and i also have its bitmap texture file (.bmp) in the same folder as the .x file (the application folder). I opened the mesh tutorial that comes with the D3D8 SDK and replaced the "tiger.x" with my "person.x" in the D3DXLoadMeshFromX function. but when i run the app i get a box with the appropriate background color, but no mesh... it appears to be doing something, just not showing my mesh... so do you know whats up with that? I tried changing the options in the conv3ds command line (-r -t to name some) and it doesnt change anything...
    To protect time is to protect everything...

  7. #7
    Zaei
    Guest
    I dont know. I usually load the texture seprately from the mesh, then associate them.

    Z.

  8. #8
    Junior Member
    Join Date
    Nov 2001
    Location
    Yorkshire, UK
    Posts
    21

    ? Ideas ?

    Hmm. If you have the SDK (sounds like you have) then check what all the variables the D3DXLoadMeshFromX function is returning. Check you are rendering all the subsets, make sure you've associated a material as well (although I doubt its that).

    Have a look if the .bmp filemame is being pulled from the x file properly too.

    If you're making something *BIG* then its worth using a resource manager. I'm doing one at the mo. Basically you need an array to hold all your textures, and another for your materials, and another for your matrices. Then associate them all together, so column one of an association table may contain....

    Subset Texture Material Matrix
    1 3 4 3
    2 4 4 2
    3 4 2 3

    Where each of the numbers is the index in the array of the texture or material or matrix that you want to use. When you enter the render subsets loop...

    For I = 1 to NumSubsets
    D3DDevice.SetTexture(AssociationTable(I).Texture)
    D3DDevice.SetMaterial(AssociationTable(I).Material)

    ' // Transformation texture code using AssociationTable(I).Matrix

    Render( Mesh.Subset(I) )
    Next

    Or something like that anyway... If you change the texture and the matrix, then you can do multipass stuff, just render to the same subset twice. You might have to change some TextureStageState settings if you really want to create some nice effects.

    Have fun anyways, I appear to have left the point a bit. The above approach saves loading textures several times and gives you a lot more program control. Make those matrices in the array move and you've got cool moving textures. Then be REALLY cool and make the second or third pass a bump pass, and you've got a VERY cool program....

    FJ
    100% of drink driving incidents are alcohol related.

  9. #9

    Thread Starter
    Addicted Member Virtual24's Avatar
    Join Date
    May 2001
    Posts
    228
    Hmmmmm......... well i don't know... i think that is what the tutorial already does... the function uses a
    Code:
    for ( DWORD i = 0; i<dwNumMaterials; i++ ) {
    .... and so on

    so i dont know what the problem is... it works with the tiger.x file that comes with the tutorial....... maybe something wrong with the conv3ds thingy????
    To protect time is to protect everything...

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