SIMatrix3.TransposeInverseInPlace

説明

この行列を、それ自身の転置逆行列に設定します(特異行列でない場合)(this = Transpose(this^-1))。

スクリプト 構文

oBoolean = SIMatrix3.TransposeInverseInPlace();

戻り値

Boolean。行列 m が逆行列を持つ(特異でない)場合は True、逆行列を持たない場合は false。

1. VBScript の例

dim m1
' Create 3x3 matrix.
set m1 = XSIMath.CreateMatrix3(2.0, 3.0, 0.0, 1.0, 4.0, 0.0, 0.0, 0.0, 1.0)
if m1.TransposeInverseInPlace then
'do something
else
'do another thing
end if

2. JScript の例

NewScene (null, false);
var oRoot = Application.ActiveProject.ActiveScene.Root
// Create two cubes, first is the original and second 
// is the one transpose inverse in place
var oCube = oRoot.AddGeometry("Cube","MeshSurface", "CubeParent")       
var oCube2 = oRoot.AddGeometry("Cube","MeshSurface", "CubeParent")      
var oTrans = oCube.Kinematics.Local.Transform
var oTrans2 = oCube2.Kinematics.Local.Transform
var oMat3 = XSIMath.CreateMatrix3()
oTrans2.GetRotationMatrix3 ( oMat3 );
// Modify the matrix to scale and rotate around z
oMat3.value(0,0) = 2 * Math.cos (45);
oMat3.value(0,1) = -2 * Math.sin (45);
oMat3.value(1,1) = 2 * Math.cos (45);
oMat3.value(1,0) = 2 * Math.sin (45);
oTrans.SetRotationFromMatrix3 ( oMat3 );        
oCube.Kinematics.Local.Transform = oTrans;
var vbArr = new VBArray( oMat3.Get2() );
var array = vbArr.toArray();
Application.LogMessage( "SIMatrix3 before transpose inverse" +
        " m00:" + array[0] + " m01:" + array[1] + " m02:" + array[2] + 
        " m10:" + array[3] + " m11:" + array[4] + " m12:" + array[5] + 
        " m20:" + array[6] + " m21:" + array[7] + " m22:" + array[8] );
oMat3.TransposeInverseInPlace()
oTrans2.SetRotationFromMatrix3 ( oMat3 );
var vbArr = new VBArray( oMat3.Get2() );
var array = vbArr.toArray();
Application.LogMessage( "SIMatrix3 after transpose inverse" +
        " m00:" + array[0] + " m01:" + array[1] + " m02:" + array[2] + 
        " m10:" + array[3] + " m11:" + array[4] + " m12:" + array[5] + 
        " m20:" + array[6] + " m21:" + array[7] + " m22:" + array[8] );
oCube2.Kinematics.Local.Transform = oTrans2;
// Expected results:
//INFO : SIMatrix3 before transpose inverse 
//              m00:1.0506439776354594  m01:-1.7018070490682368 m02:0 
//              m10:1.7018070490682368  m11:1.0506439776354594  m12:0 
//              m20:0                   m21:0                   m22:1
//INFO : SIMatrix3 after transpose inverse 
//              m00:0.26266099440886486 m01:-0.4254517622670592 m02:0 
//              m10:0.4254517622670592  m11:0.26266099440886486 m12:0 
//              m20:0                   m21:0                   m22:1

関連項目

SIMatrix3.TransposeInverse SIVector3 SIMatrix3 SIMatrix4 SIRotation SITransformation SIQuaternion