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

Pivot Point ?

Last post 2/22/2010 12:57 PM by Nightro. 13 replies.
  • 4/24/2007 2:19 AM

    Pivot Point ?

    These posts on animation are important to those who come
    searching for the solution to this.

    One Problem Left:  How do you set the point in which the model part revolves around?

    Im playing around with the pivot point in 3ds.  Am I going in the right direction
    or is there something else?

  • 4/24/2007 4:19 AM In reply to

    Re: Pivot Point ?

    Matrix rotations take place about the origin. Each ModelMesh has a bone attached which sets a transform matrix for it. That transform matrix includes a displacement which is the local origin of that mesh. I struggled with 3ds max to alter that, but tinkering with the pivot point settings didn't help.

     

    In a more general sense, if you want to rotate anything about some point P you do the following:

    1) Translate by -P

    2) Rotate as desired

    3) Translate by P

     

    Multiply those 3 matricies together and you have a "rotate about a pivot point" matrix.

    Brandon Bloom
    Software Design Engineer
    XNA Platform and Tools
  • 4/24/2007 3:51 PM In reply to

    Re: Pivot Point ?

    I REALLY appriciate your reply!

    But the thing Im confused about is that the simple animation sample
    they have here has a tank full of moving parts, all moving around their
    own points and absolutly no code that I can see that sets these points.

    I tried making a simple model with 2 boxes close to each other.
    One is the child of the other.  I tried rotating the child around X
    and it was like the pivot point was at the edge of the box.
    I tried rotating around the Y with the same result.  For some reason
    when I rotated around the Z, it rotated perfectly around the center.

    Got to be something I am missing.   This question if possible should be
    answered by one of the developers of XNA since the sample is so simple
    and clear but the results dont match it with the same code in my program.

    Something in the model ?

     

  • 4/24/2007 4:07 PM In reply to

    Re: Pivot Point ?

    The pivot points in the tank were defined in the modelling package where it was built. It was created as a hierarchical model (I believe in Maya) where each object is parented to the thing it is supposed to rotate around, and with the local origin of each child object set to the pivot point. That way the game code can just rotate each object around its local origin, and the artist has control over where those pivot points will be.
    XNA Framework Developer - blog - homepage
  • 4/24/2007 4:25 PM In reply to

    Re: Pivot Point ?

    Bingo !

    Thank You

    For anyone creating models that use the pivot points,
    XNA does not play nice with 3ds.  I have to export it from
    maya to make it work.

  • 8/25/2007 6:51 PM In reply to

    Re: Pivot Point ?

    How did you get it to work? In Maya if I hit "INSERT" and alter the Pivot Point then Export to FBX It does absolutely nothing. It still rotates around its origin. I would love to see someone put together a little tutorial of the steps because I really cannot see where im failing.
  • 8/27/2007 2:05 AM In reply to

    Re: Pivot Point ?

    k00ksta:
    How did you get it to work? In Maya if I hit "INSERT" and alter the Pivot Point then Export to FBX It does absolutely nothing. It still rotates around its origin. I would love to see someone put together a little tutorial of the steps because I really cannot see where im failing.


    I'm pretty sure that doesn't actually do anything outside of Maya. I believe the local origins for mesh parts are calculated as vertex averages during exporting so there really isn't anyway to just change it. As for specifying a different pivot point, you would have to do as Brandon showed by doing it in code.
  • 4/28/2008 2:43 PM In reply to

    Re: Pivot Point ?

    Hi guys,

    we had the same problem exporting our 3d models from 3ds max 9 to fbx format: meshes had a totally different turning point in XNA than the location of the pivot points in max. Apparently the fbx exporter of max does not export the pivot positions in a correct way. We found two ways to work around this.

    1) First option has already been mentioned: use Maya. We exported our model from 3ds max to .fbx format and imported it into maya 2008 where we exported it again in the fbx format (fbx-plugin for maya is available at autodesk.com). Now the pivot points were exported in a correct way and thus okay in XNA.

    If you don't have Maya or just want to stick to Max one can also do the following:

    2) install the .X format plugin by Pandasoft (www.andytather.co.uk) and export the model in .X format (which is the DirectX format). Now the pivot points should be okay in XNA as well. However, this does mean a switch from .fbx format to .X format.

    Hope this helps!

  • 4/29/2008 2:05 AM In reply to

    Re: Pivot Point ?

    I've been using Blender and exporting my models to .X format, and within Blender I am able to set the origin point and change it (and the changes are apparent in XNA).  It sounds like HugoB may have hit on the problem - the FBX exporter for 3DS Max may not export the origin stuff correctly.  Perhaps you can find an updated version of the exporter or else you may have to use an exporter from another program like Maya or possibly even Blender (although I haven't used the FBX exporter from Blender much, so I'm not sure if it does the origin point correctly).
  • 11/5/2009 4:18 AM In reply to

    Re: Pivot Point ?

    Kk, I got my parts solve so I must as well share my experience.

    Works great for solution 1. (Export to maya from max and then export again)

    Solution 2 does not work. (Export using panda to .x format)

    My Specifications:
    -XNA 3.1
    -Autodesk 3DS Max 2009
    -Autodesk Maya 2010
    -Latest FBX Exporter, using binary Export, FBX Version FBX201000
    -Using SkinningSample from XNA
    -Not using any IK, just bones link to the chest bone (Root bone)

    Also:

    -Pivot becomes distorted and wrong when bones are scaled in 3DS max. So... DO NOT SCALE YOUR BONES. You can however modify the width and height in the property panel on the right. If you already bone and scale, then you have to delete all your bones and rebone.
    -3DS max FBX Exporter plugin must also be the latest when exporting.
    -3DS Max is very buggy, sometimes you may want to close the whole application down and reopen it again and then repeat just to make sure it's not cause of lack of memory and stuff.

    Good luck!
  • 11/5/2009 5:05 AM In reply to

    Re: Pivot Point ?

    Chew. Im not sure if everything you just sid is correct.  I know at one point in time I thought the same thing.

    the 3ds max fbx export is not buggy.  I used to say the same thing.

    And I know that they say you can't scale bones, but I think that you actually can.  I havent tried.

    The issue with thinking your pivots are messed up came up for me when i did not know HOW to export to FBX from 3ds max.

    In your animation your character must be in its starting pose at FrAME 0.  Not only that, the time slider must be at FRAME 0.  Try that and see if you end up thinking that the exporter is still buggy.
  • 11/5/2009 5:15 AM In reply to

    Re: Pivot Point ?

    3DS Max is very buggy

    I have spent 8 hours a day for the last two days inside 3ds Max, and not had to restart it once. I even left it on overnight. I've been using custom exporters and DirectX shaders all the time, too. (This is 3ds Max 2009 32-bit running on Windows 7)

    If you're having problems with Max, then make sure that you're not using some third party plug-in that may have a bug. Also make sure that your system is in good working order (passes memtestx86, scandisk etc).

    In my opinion, the view that 3ds Max is "buggy" is unfair; I've had just as many problems with Maya, and even more with TrueSpace, XSI and Blender. The main weakness of 3ds Max is if you install some buggy plug-in; it can ruin your day, and it's often not easy to track down what, specifically, is the cause of your problems.

    And, to re-iterate the solution above: The pivot point in 3ds Max turns into the Bone transform in the exported Model, which means that it's the point that your assembly/object/hierarchy will rotate around. Scaling bones may or may not work, depending on how your rendering and animation system is put together. It's quite possible to support scaling in bones (even shear!), but it requires a lot more effort in the animation code, and will run slower, so most game engines don't.

    Btw: if you have problems with your FBX files, you can try the kW X-port plug-in to export to .X instead. It's now up to version 1.4.4, and supports most of the features in Max that you can use in the XNA Model class (and then some!).

    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
  • 1/21/2010 11:16 PM In reply to

    Re: Pivot Point ?

    To use the world origin in 3DS Max as your pivot point, you have to reset the XForms on your model before you export.

    To do this, go to the Utilities tab in the toolbar on the right hand side (the hammer icon) > go to Reset XForm > scroll down and click Reset Selected.

    This will add another item to your object's stack that resets the transform matrices on your model.
  • 2/22/2010 12:57 PM In reply to

    Re: Pivot Point ?

    I was experiencing this problem in XSI, which doesn't have a solution offered in this thread. However, I found this thread useful.

    In particular:

    Alexandre Jean Claude:
    If you switch to pro-mode you can also select the center of the mesh and move it to the right place. (right around the big select arrow, there is a center button)


    In the latest version I didn't have to switch to a "pro mode" (maybe because I have XSI mod tool pro since I have a premium membership?). I merely clicked the 'center' button on the right hand side as described above and then used the transform tool to adjust the pivot. The visual is a little deceptive (a grayed out gizmo tool moving in the opposite direction you're dragging?) but it works.


Page 1 of 1 (14 items) Previous Next