Mesh files and Textures

hog

Well-known member
Joined
Mar 17, 2003
Messages
984
Location
UK
I have been working through the Tutorial6 that comes with the SDK.

I created a mesh in anim8or, converted it to an .X file and loaded it successfully in VB.NET using the code from Tutorial6.

The problem I have is that the SDK sample has the texture in the file tiger.bmp which the program loads.

My .X file must have the textures in it as it appears the same using meshview as it does in anim8or.

Does anyone know how to get at the texture detail in the .X file so my mesh looks correct when displayed in the VB program?

Thnx
 
Yes. The pig mesh Im using is displayed pink in anim8or and meshviewer along with the nice hue, ambience etc.

But in VB.NET when I load it into DX9 it is just plain with just a solid colour, not matching the true colour
 
Not sure if this is the answer but Ill look into to it and report back.

I got this feedback from the anim8or forum...

Using a texture requires an image file like
a bmp,jpg,etc...What you want,I think, is
to add a material to your mesh.
 
Did you apply a texture to your mesh in the program? Im not familiar with anim8tor so cant help you there. If you did apply it and it exported correctly it should be there, if you store the texture in the right path. If not, then if you have the X file generated in Text mode, scroll through the file and see if you can find some kind of a path under the list of vertices.

One more thing, if you dont wish to spend much money on a 3d modeller, but can spend a decently low sum of $25 then get Milkshape3D. It contains a GREAT DirectX mesh exporter, and some good features. It is worth every dollar spent on it.
 
Hi, thanks I did look at Milkshape but I think anim8or is far better, even more so as its free:)

Right thinking thru this whilst dropping off to sleep last night I came to this conclusion.

Lets say I have created a sphere and applied a material to it then convert to .X

Therefore I have the material info I should think in the .X file along with all the other detail. I suspect what I have done is got confused with textures and materials and hacked the SDK sample to open my mesh. But the SDK sample is geared to use a texture so I think that is where my problem lies.

I need to revisit the code and modify to handle material not texture......I think?
 
OK I got it to load OK and the colours seem OK but it does not have the metalic look with specular light etc as seen in meshviewer etc?

I have used these two lines to try to help but no joy:(

Code:
m_obj3DDevice.RenderState.Ambient = System.Drawing.Color.Pink
m_obj3DDevice.RenderState.SpecularEnable = True
 
Back
Top