XNA Creators Club Online
Page 1 of 1 (5 items)
Sort Posts: Previous Next

3DS Max Axis Messed Up

Last post 2/10/2010 10:52 AM by EJDSlayer. 4 replies.
  • 2/9/2010 12:00 PM

    3DS Max Axis Messed Up

    Hi everyone,

    I am trying to export from 3DS max to XNA, which I have done multiple times before with no issues. This time the XNA studio seems to be ignoring all the axis data from 3DS max, so when I export it the ship is always facing the wrong way. Is there any reason it would be doing this, or can anyone tell me their settings for 3DS Max 2010 -> .FBX format, as mine do not seem to be working anymore.

    Below is a summary of what I am using, both in XNA and 3DS Max:

    XNA Draw Function:

    void DrawGameObject(GameObject gameobject)
            {
                Matrix[] transforms = new Matrix[gameobject.model.Bones.Count];
                gameobject.model.CopyAbsoluteBoneTransformsTo(transforms);

                foreach (ModelMesh mesh in gameobject.model.Meshes)
                {
                    foreach (BasicEffect effect in mesh.Effects)
                    {
                        effect.EnableDefaultLighting();
                        effect.PreferPerPixelLighting = true;

                        //effect.World = Matrix.Identity;
                        effect.World = Matrix.CreateScale(gameobject.scale) *
                                       Matrix.CreateFromQuaternion(gameobject.rotation) *
                                       Matrix.CreateTranslation(gameobject.position);

                        effect.Projection = projectionMatrix;
                        effect.View = viewMatrix;

                        graphics.GraphicsDevice.SamplerStates[0].AddressU = TextureAddressMode.Wrap;
                        graphics.GraphicsDevice.SamplerStates[0].AddressV = TextureAddressMode.Wrap;
                    }
                    mesh.Draw();
                }
            }

    3DS Max:

    TurboSmooth : On.
    Convert Deforming Dummies to Bones: On.
    Units: Inches.
    Axis Conversion: Y-up.
    FBX File Format: Binary, FBX201000

    Other:

    I have also noticed that within 3DS Max, the axis are always Z up in the bottom left hand corner, but within the view ports my objects axis are Z up, except for on the left where it is Y up. Is there anyway to make this one z up too, as this could be the issue?

    Thanks,
    Slayer
  • 2/9/2010 1:58 PM In reply to

    Re: 3DS Max Axis Messed Up

    I don't fully understand this issue myself but ...

    as far as I can tell the xna importer ignores the axis conversion so I used a custom processor:

    [ContentProcessor(DisplayName = "Game Model Processor")] 
    public class GameModelProcessor : ModelProcessor { 
        public GameModelProcessor() { 
            RotationX = -90.0f; 
            ColorKeyEnabled = false
        }//method 
    }//class 

    that way I can use default settings when exporting

    I would love to know the full story but the whole modelling topic is way too fiddly buggy and boring

  • 2/9/2010 3:10 PM In reply to

    Re: 3DS Max Axis Messed Up

    Hey,

    Firstly thanks for the reply, I know what you mean about it being buggy! At the moment I am just rotating it within my world matrix, just so I can work on the movement of my main object, so I will try what you suggest later. It's weird because i've never had this problem before, I had weird importing objects but managed to fix it, but I really can't remember how. So I will go back over all my old code at some point and see if I can give some further insight into this.

    If anyone else has any other suggestions they are more then welcome :)

    Thanks
  • 2/9/2010 11:53 PM In reply to

    Re: 3DS Max Axis Messed Up

    Did you change the version of the FBX exporter you're using? As far as I can tell, they keep changing their minds on that in the different versions.

    Also, I'd recommend using kW X-port instead of FBX, as IMO it's a little more consistent when going from Max to XNA. I may be a little biased, though :-)
    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
  • 2/10/2010 10:52 AM In reply to

    Re: 3DS Max Axis Messed Up

    Hey,

    Yeah I downloaded kw x-port ages back, thanks for the good work there. The only issue I had is I did not fully understand what options I needed to include, and what ones I didn't. Is there any chance you can pass me some good settings for it, as I am not very good when it comes to animation / 3DS max exporting.

    Thanks :)
Page 1 of 1 (5 items) Previous Next