SITransformation
 
 
 

SITransformation

Object Hierarchy | Related C++ Class: CTransformation

Description

This object represents a transformation which is the result of the combination of a Scaling, a Rotation and a Translation, in the S.R.T order.

Methods

AddLocalRotation AddLocalScaling AddLocalTranslation AddParentRotation
AddParentScaling AddParentTranslation Copy GetMatrix4
GetRotation GetRotationAxisAngle GetRotationAxisAngle2 GetRotationMatrix3
GetRotationQuaternion GetRotationXYZAngles GetRotationXYZAnglesValues GetRotationXYZAnglesValues2
GetScaling GetScalingOrientationXYZAngles GetScalingOrientationXYZAngles2 GetScalingValues
GetScalingValues2 GetTranslation GetTranslationValues GetTranslationValues2
HasScalingOrientation Mul MulInPlace SetIdentity
SetMatrix4 SetRotation SetRotationFromAxisAngle SetRotationFromMatrix3
SetRotationFromQuaternion SetRotationFromXYZAngles SetRotationFromXYZAnglesValues SetRotationFromXYZAxes
SetScaling SetScalingFromValues SetScalingOrientationFromXYZAngles SetTranslation
SetTranslationFromValues      
       

Properties

Matrix4 PosX PosY PosZ
RotX RotY RotZ Rotation
Scaling SclX SclY SclZ
Translation      
       

Examples

1. JScript Example

/*
        Example of how to use the SITransformation to read and write 
        the scaling, rotation and translation of an object
*/
var oNull = Application.ActiveSceneRoot.AddNull( "MyNull" ) ;
// Change the position and rotation of the null
// by providing a new transform
oNewLocalTransform = XSIMath.CreateTransform() ;
// Change posx, posy
oNewLocalTransform.PosX = 5; 
oNewLocalTransform.PosX = 6; 
// Set rotx to 180 degrees
oNewLocalTransform.RotX = 180;
// Scale y-axis (scly)
oNewLocalTransform.SclY = 2; 
oNull.Kinematics.Local.Transform = oNewLocalTransform ;
PrintTransformation( oNull.Kinematics.Local.Transform ) ;
// Show the "SRT: of a SITransformation object
function PrintTransformation( in_oTransform )
{
        var oVector = XSIMath.CreateVector3();
        in_oTransform.GetScaling( oVector ) ;
        PrintVector( "Scaling:", oVector ) ;
        // In Radians
        in_oTransform.GetRotationXYZAngles( oVector ) ;
        PrintVector( "Rotation:", oVector ) ;
        in_oTransform.GetTranslation( oVector ) ;
        PrintVector( "Translation:", oVector ) ;
}
// Print a vector.  Values are rounded to 3 decimal places
function PrintVector( in_Prefix, in_oVec )
{
        Application.LogMessage( in_Prefix + " " + 
                        XSIRound(in_oVec.x,3) + ", " + 
                        XSIRound(in_oVec.y,3) + ", " + 
                        XSIRound(in_oVec.z,3) ) ;
}
// Output:
//INFO : Scaling: 1, 2, 1
//INFO : Rotation: 3.142, 0, 0
//INFO : Translation: 5, 6, 0

2. VBScript Example

dim transfo
set transfo = XSIMath.CreateTransform
Application.LogMessage TypeName(transfo)

See Also

SIVector3 SIMatrix3 SIMatrix4 SIRotation SITransformation SIQuaternion KinematicState.Transform StaticKinematicState.Transform