Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® FBX® / FBX SDK / Does SetRotationOrder work?
  RSS 2.0 ATOM  

Does SetRotationOrder work?
Rate this thread
 
63591
 
Permlink of this thread  
avatar
  • Total Posts: 52
  • Joined: 07 December 2007 02:15 PM

I am writing meshes as instances and supplying rotations and translations for nodes.
However when I supply the required euler angles ( why cant we just write a quaternion ????? ) they are not interpretted in the correct order.  I only write geometry no animation. Why does it always order as X Y Z even though I set the order as Y Z X?  I use SetGeometricRotation to set the values.  This is sdk version 2011.3.1.



Replies: 2
/userdata/avatar/vx3501hqr_small.jpg

Should use LclRotation.Set(FbxDouble3), not SetGeometricRotation.
Geometric rotation can not be inherited across the hierarchy, it is not the general local rotation you want to use in this case.

Author: Jiayang Xu

Replied: 16 January 2012 12:52 PM  
/img/forum/dark/default_avatar.png

From my testing when writing a FBX file LCLRotation.Set does nothing.  Does it need some sort of activation command to make it work?  Does it work with ANY rotation order command?  Show me the lines of code that will export a NODE
so that its sits correctly rotated for euler 20,90,0 (x,y,z) .  Thus an object facing left and rotated out of the screen 20 degrees.
This utilizes a rotation order of YZX or ZYX but NOT XYZ.  For instance this:
KFbxVector4 lT, lR, lS;
KFbxXMatrix lGM;

lR.Set( 20.0,90.0,0.0);
lT.Set( 0,0,0);
lGM.SetT(lT );
lGM.SetR( lR );
lNode->LclTranslation.Set( lGM.GetT() );
lNode->RotationOrder.Set( eEULER_ZYX );
lNode->LclRotation.Set( lGM.GetR() );
lNode->LclScaling.Set( lGM.GetS() );

Will not output a node referencing a mesh at any angle.  It wont show rotated in my code or in 3DSMAX 2012.
Whats wrong?

Author: normalblock8byteslong

Replied: 17 January 2012 12:01 AM  
avatar

does it work correctly with setrotationorder?



Replies: 1
/img/forum/dark/default_avatar.png

From my testing when writing a FBX file LCLRotation.Set does nothing.  Does it need some sort of activation command to make it work?  Does it work with ANY rotation order command?  Show me the lines of code that will export a NODE
so that its sits correctly rotated for euler 20,90,0 (x,y,z) .  Thus an object facing left and rotated out of the screen 20 degrees.
This utilizes a rotation order of YZX or ZYX but NOT XYZ.  For instance this:
KFbxVector4 lT, lR, lS;
KFbxXMatrix lGM;

lR.Set( 20.0,90.0,0.0);
lT.Set( 0,0,0);
lGM.SetT(lT );
lGM.SetR( lR );
lNode->LclTranslation.Set( lGM.GetT() );
lNode->RotationOrder.Set( eEULER_ZYX );
lNode->LclRotation.Set( lGM.GetR() );
lNode->LclScaling.Set( lGM.GetS() );

Will not output a node referencing a mesh at any angle.  It wont show rotated in my code or in 3DSMAX 2012.

Author: normalblock8byteslong

Replied: 17 January 2012 12:02 AM  
avatar

To put it into context this is what I am doing:

I have a model.  Its at 0,0,0 with no orientation.

I want to same it to fbx and store 3 instances all at the same rotation, say 20,90,0.

When I do this the first instance will not accept any orientation.  subsequent instances will
accept lclrotations and I just got setrotationorder to function with it, but the intal instance
wont rotate? 

Whats wrong?



Replies: 0
avatar

Hello, I cannot reproduce the problem that the first instance can not be oriented by both 2011.3.1 and 2012.2.
I attached the Instance sample from 2012.2, my experiment is based on this sample.
You just need to disable the animation part in that sample and set LclRotation and RotationOrder in CreateCubeInstance to do a quick test.

Hope it will help.
If not, please send us your code snippet that generate instance for further investigation.
Thanks.



Jiayang Xu
Maya Data Platform
Autodesk

Attachment Attachment
Replies: 1
/userdata/avatar/vx3501hqr_small.jpg

But I do noticed the rotationOrder change is not stored in generated FBX files, I will take a look at that tomorrow.

Author: Jiayang Xu

Replied: 18 January 2012 10:10 PM  
avatar

Thanks.  I had a code error where I had not reduced the controlpoint count down to a single part.  This caused part of the issue,and messed up teh fbx file ( allways look at the ascii !! ).

However now if I use the code as per example it works, but, if materials are loaded and assigned, then the inital first node reference does not display.  I have to create a third node.  ARe there any material config parameters that are not compatible with instancing a node ?



Replies: 0
avatar

Hello, I don’t think there are limitations to assign materials on instances.
Please refer to the attached updated version of Instances sample which adds materials for instances.

And to assign different rotation order other than XYZ, KFbxNode::SetRotationOrder() should be used.
But property RotationOrder should work too, which does not, it seems the two ways kind of confusing and not synced. I will log that.
Thanks.



Jiayang Xu
Maya Data Platform
Autodesk

Attachment Attachment
Replies: 0