Object Hierarchy | 関連する C++クラス:CTransformation
ISITransformation オブジェクトは、スケーリング、回転、移動を S、R、t の順で組み合わせた結果である変換です。
/* 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 |
dim transfo set transfo = XSIMath.CreateTransform Application.LogMessage TypeName(transfo) |