Textures in the Mesh File

decrypt

Junior Contributor
Joined
Oct 6, 2003
Messages
216
I want to be able to load a mesh into vs.net without having to define the textures at all, but use the texture information in the .x file. I am using the code at http://www.xtremedotnettalk.com/showthread.php?t=95349 .

How would I be able to load a mesh file into vs.net by using the texture information in the .x file?

Answer in either c# or vb.net

Thanks a lot in advance,
decrypt
 
Ok, I've had enough of searching around on the internet for how to do that.

How would I be able to texture the following .x file of mario? I want to use three colors to do it
 

Attachments

I created the file in blender with the textures on it (that are just colours). I import it and I get a white mesh that isn't textured. How could I texture it from the information in the file?
 
I'm not sure, when you use 'color' materials in a 3D model, I believe that will only be noticable in that 3D Modeling Software's interface, you would need to use a bitmap texture of that color.

To save space you could make three small, 32x32, bitmaps of all the color you wish, when you export that to .X it should also output the texture (bmp) files in the same directory.
 
Oh, that seems to make sense. I'll try that.

One more question though, is that when I load the mesh will it load those textures, do I have to somehow get the path of the bitmaps from the .x file and load them in?

Edit:

btw, when I view it in the directx view it views to colour.
 
Last edited:
That's interesting, if the .X viewer shows the colors, there must be something that I didn't impliment in my clsMesh code. But, the clsMesh that you are using will automatically load the associated textures if they are in the same directory as the .X file.
 
hmm... do you think there is anyway to load the materials colour instead of loading in the texture from the file?
 
Back
Top