RE: : SetRotationFromQuaternion

Date : Wed, 6 Jun 2007 23:57:37 +0100
To : <XSI(at)Softimage.COM>
From : "Brent McPherson" <brentmc(at)Softimage.COM>
Subject : RE: : SetRotationFromQuaternion
Robert,
 
have you verified that the ordering of the quaternion components is the same?
 
Quaternions in XSI are defined as w,x,y,z but perhaps your .csv file is ordered x,y,z,w?
 
Just an idea...
--
Brent


From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Robert Moodie
Sent: Wednesday, June 06, 2007 11:38 PM
To: XSI(at)Softimage.COM
Subject: SDK:: SetRotationFromQuaternion

I'm reading in a data file (.csv) and setting rotations from Quaternion data.
My problem is although the anim is working, the rotation values are wrong. I don't think that the SetRotationFromQuaternion method needs a Degrees2Radians conversion - is that right?
 
<--------------------------------------------------8<--------------------------------------------------------------->
var >   var >   var oTrans = XSIMath.CreateTransform();
   var oQuat = XSIMath.CreateQuaternion();
   
   for (x=1; x<=intEndFrame; x++)
    {
    s = ts.ReadLine();
    var a = s.split( "," );
    oQuat.Set(
     parseFloat( a[ 0 ] ),
     parseFloat( a[ 1 ] ),
     parseFloat( a[ 2 ] ),
     parseFloat( a[ 3 ] ) );
    
    oTrans.SetRotationFromQuaternion  ( oQuat );
    oNull.Kinematics.Local.Transform = oTrans;
 
    // Set keys, blah blah
<--------------------------------------------------8<--------------------------------------------------------------->
 
Cheers
_rob
 
 

ROBERT MOODIE
td :: pipeline/r&d

Groupe Image Buzz Inc.
312, rue Sherbrooke Est
Montréal (Québec)
Canada  H2X 1E6

 T  (514) 848-0579_1 800 567 0200
www.buzzimage.com

 

Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.