I'm using this procedure to load a mesh .x file
It came from microsoft direct3d example, and it works but just if i load tiger.x file.
while if i try to load other normal mesh i get the following error:
---------------------------
---------------------------
Application Error.
-2005529767 (D3DXERR_INVALIDDATA)
at Microsoft.DirectX.Direct3D.TextureLoader.FromFile(Device device, String srcFile)
at Load_X_File(String path) in c:\documents and settings\me\documents\visual studio projects\pk\form1.cs:line 445
this is the code
device.RenderState.ZBufferEnable = true;
device.RenderState.Ambient = System.Drawing.Color.White;
ExtendedMaterial[] materials = null;
Mesh temp = new XFileObject();
temp = Mesh.FromFile(path, MeshFlags.SystemMemory, device, out materials);
if(meshTextures == null)
{
meshTextures = new Texture[materials.Length];
meshMaterials = new Direct3D.Material[materials.Length];
for(int i=0; i<materials.Length; i++)
{
meshMaterials = materials.Material3D;
meshMaterials.Ambient = meshMaterials.Diffuse;
meshTextures = TextureLoader.FromFile(device, materials.TextureFilename);
}
}
what does it depend by?