Sign in to follow this  

[MDX] Can not load material of an .x model exported from Maya

This topic is 4353 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am writing a simple Managed DirectX program which reads and renders a simple cube exported from maya. The DirectX Extension for Maya 7.0 is properly installed. The .x file can be viewed using DirectX Viewer without problem. However, my code cannot load the material properly and the whole model is black. The code is actually part of the Tom Miller's tutorial program. It reads his Dodger Car model happily. I think there must something wrong when I export it from Maya. I am new to DirectX. Can anyone give me some clue? Thanks

Share this post


Link to post
Share on other sites
I just checked the Dodger Car chapter in the MDX book and it looks like Tom's doing some fancy things when loading the mesh, using ref parameters for filling in the texture and material information. It should work, but you might want to try your mesh with the MeshFile program he introduced in chapter 5 first. This one works a bit more straightforward, so it's easier to see where things might be going wrong (either way, you should probably get yourself the updated source code for the book from ZBuffer, if you haven't already).

If you still have the MeshViewer utility around (from the August 2005 or earlier SDK release) you can check out the properties of your mesh to see if it includes normal and uv mapping information, which is needed to properly render it (provided you are using textures). Also make sure you've put your textures files (again, if you use any) in the correct directory, so your app can load them properly.

And finally, there might be something off with the lighting in your game. Check the code where you set up your lights on the device and see if that's correct. To test if the problem is caused by the mesh or the lighting, you can disable all lighting by calling device.RenderState.Lighting = false;

Hope this helps!

and with that, it's back to work for me :((

Share this post


Link to post
Share on other sites

This topic is 4353 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this