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

Export simple box from max

Last post 11/12/2009 9:00 PM by Cosmos. 4 replies.
  • 11/12/2009 7:24 AM
    • (190)
    • premium membership
    • Posts 52

    Export simple box from max

    Hello.
    When I export a sphere from max, it's origin in my game is correct. When I export a box, however, the origin is at the center of the bottom face. When I export a sphere and box together, the sphere's origin is still at zero, but the box's origin is still wrong. Changing the pivot point and/or actual origin in max does nothing. I am exporting as a .X, though I have also tried fbx.
    Thanks.

    Edit: I should mention that the models look fine in the .X viewer. Also, rotations in max change nothing to the model loaded in the game.
    In playtest: Avatar Hamster Panic
  • 11/12/2009 1:25 PM In reply to

    Re: Export simple box from max

    Select the box, goto the Transform Toolbox (I think under Edit) Then select the R button (resets transforms) and then click the Origin button (sets pivot to origin).
    Then the box should show up under the correct location in XNA and the viewer.
  • 11/12/2009 6:58 PM In reply to
    • (190)
    • premium membership
    • Posts 52

    Re: Export simple box from max

    yxrkt:
    Changing the pivot point and/or actual origin in max does nothing.


    Thanks for the reply though. I also forgot to mention that resetting the transform doesnt' seem to do anything.

    Right now, I'm using the GameStateManagement example code with almost no modifications. My rendering looks something like this:


    foreach ( ModelMesh mesh in model.Meshes )
    {
      foreach ( BasicEffect effect in mesh.Effects )
      {
        effect.EnableDefaultLighting();
        effect.DiffuseColor = Color.White.ToVector3();

        Matrix matWorld;
        something.GetTransform( out matWorld ); // 'something' is the thing containing the model

        effect.World = matWorld;
        effect.View = matView;
        effect.Projection = matProj;
      }

      mesh.Draw();
    }


    Do I need to configure the content manager somewhere to tell it not to be dumb?
    In playtest: Avatar Hamster Panic
  • 11/12/2009 7:18 PM In reply to
    • (190)
    • premium membership
    • Posts 52

    Re: Export simple box from max

    So, it turns out that when it was exporting, it exported it as a model with frames and had transforms in the frames (despite resetting the transform in max). Exporting without frames seems to work. Thanks again csharp and anyone else who's put any thought into my problem.
    In playtest: Avatar Hamster Panic
  • 11/12/2009 9:00 PM In reply to

    Re: Export simple box from max

    Hi all,

    You should modify the cube pivot center. In this particular case, you should go to "Hierarchy" panel, then Pivot -> Affect Pivot -> Center to Object.

    This way, your cube (or any object) pivot location will be at object center. It is always a good idea to add a "XForm" modifier at the top of the stack before export.

    Hope that helps.
Page 1 of 1 (5 items) Previous Next