|
-
Feb 9th, 2002, 04:49 PM
#1
Thread Starter
Addicted Member
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...
-
Feb 9th, 2002, 05:06 PM
#2
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.
-
Feb 9th, 2002, 05:29 PM
#3
Thread Starter
Addicted Member
-
Feb 9th, 2002, 05:37 PM
#4
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.
-
Feb 9th, 2002, 05:39 PM
#5
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.
-
Feb 19th, 2002, 12:20 AM
#6
Thread Starter
Addicted Member
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...
-
Feb 19th, 2002, 09:02 AM
#7
I dont know. I usually load the texture seprately from the mesh, then associate them.
Z.
-
Feb 19th, 2002, 09:57 AM
#8
Junior Member
? 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.
-
Feb 19th, 2002, 04:25 PM
#9
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|