Mesh file with texture?

I have a .x file, which loads fine in the DirectX viewer. The viewer shows the model with texture. So am I right in saying that the .x file has texture within it?

If so, how do I get at it? So far I've only been able to load the mesh and render some random texture on it from a JPG.

this.mesh =Mesh.FromFile(@"..\..\Content\Models\" + meshPath,MeshFlags.Managed, device);

[627 byte] By [r3n] at [2007-12-29]
# 1

You’ll have to use the other mesh loader, the one that uses the extended materials, that’s where the texture file name is held. Mind you, generally it’s only the file name so you’ll have to splice the path so you get the full path. Have a look at Tutorial 6 in the samples section on how to extract the data.

BadHabit at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 2
Usually what happens is that when the .x file is created, the full path name is placed inside the .x file. You can open the .x file in notepad and search for .jpg, .bmp, .png or any other format and find the path of the texture.

I've had that problem many a times before, you can then manually edit the .x file's associated texture path to be more generic in the sense of textures\someTexture.jpg.

I hope this helps.
Take care.

PieterGermishuys at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 3
Thanks guys!
r3n at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...