2

I am working on a project which requires taking fbx models and viewing them in a THREEJS viewer. Most of the time these models come in with the correct pivot points but other times they do not. I am having a hard time figuring out what is causing this issue.

I am using this script to do the conversion from fbx to json:

https://github.com/mrdoob/three.js/blob/master/utils/converters/fbx/convert_to_threejs.py

You can find an example of an fbx file that has the wrong pivot point here:

http://s000.tinyupload.com/index.php?file_id=42525924957536854290

This model contains only one mesh and was exported from Maya with FBX Plugin version 2014.0.1. The pivot should be near the center of the model but it located at the bottom of the model when loaded in threejs. It appears to be placing the pivot at (0,0,0).

I ran a test on this model using the online model viewer at https://clara.io/. When I import the model using the fbx everything looks normal as can be seen here:

enter image description here

Next, I then export this model as THREEJS Scene json by using File -> Export All -> Threejs Scene. When I import the json I just exported via clara.io back into clara.io the pivot is wrong. This is the model after reimporting it as json into clara.io

enter image description here

Any suggestions on how to get the pivot points to always match up between Maya and Threejs would be greatly appreciated.

1 Answer 1

3

The issue is that ThreeJS doesn't support Pivots that are different than Transform origin of a model. This is actually somewhat standard for Game Engines.

What I would suggest is to first "Reset Pivots" in Clara.io on this object, and then go into Vertex mode in Clara.io on this object and select all vertices. Move the vertices so that they are relative to the Reset Pivot. This is letting you set any pivot you want because you are moving the vertices relative to the origin of this model. Then when you export, you will have your new pivot.

We can look at adding support for baking pivots. But it is a little complex because there are multiple distinct pivots -- one for scale and a separate one for rotation, so I guess we have to give you the option of which you want to bake into the object.

Best regards, Ben Houston, [email protected]

2
  • Thanks a lot for this answer. Makes perfect sense to me now. Now I just need to look into if there is anyway to automate a process for fixing this. The system I am working on requires no people to touch the model in order to fix pivots.
    – Matt
    Feb 24, 2015 at 17:59
  • We could add it as an option when exporting to ThreeJS -- bake pivot: None, rotation, scale.
    – bhouston
    Feb 24, 2015 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.