IC8 Python API:RLPy RMatrix4

From Reallusion Wiki!
Jump to: navigation, search

Contents

Main article: iC8 Modules.
Last modified: 10/21/2026

Description

This class represent the transform data of RTransform. This class provides access to RLPy's internal 4x4 matrix operators and related functions.

Public Methods

RLPy.RMatrix4.AccuRotate(self, rkRotate)

Accumulate matrix with rotation matrix.

Parameters

rkRotate[IN] Rotation matrix - RLPy.RMatrix3

Returns

Return a new matrix (*this) *= Accumulate - RLPy.RMatrix4

 1 matrix4_orgin = RLPy.RMatrix4()
 2 matrix4_orgin.MakeIdentity()
 3 matrix3_orgin = RLPy.RMatrix3()
 4 matrix3_orgin.FromAxisAngle( RLPy.RVector3( 0, 1, 0 ), 90 * RLPy.RMath.CONST_DEG_TO_RAD )
 5 matrix4_orgin.AccuRotate(matrix3_orgin)
 6 matrix4_orgin.AccuRotate(matrix3_orgin)
 7 
 8 rotate = RLPy.RMatrix3()
 9 matrix4_orgin.GetSimpleRotate( rotate )
10 row0 = rotate.GetRow(0)
11 
12 print(row0[0])
13 print(row0[1])
14 print(row0[2])

RLPy.RMatrix4.AccuScale(self, rkScale)

Accumulate matrix with scale vector.

Parameters

rkScale[IN] Scale vector - RLPy.RVector3

Returns

Return a new matrix (*this) *= Accumulate - RLPy.RMatrix4

 1 matrix4_orgin = RLPy.RMatrix4()
 2 matrix4_orgin.MakeIdentity()
 3 matrix4_orgin.AccuScale(RLPy.RVector3( 2, 2, 2 ) )
 4 matrix4_orgin.AccuScale(RLPy.RVector3( 3, 3, 3 ) )
 5 
 6 result = matrix4_orgin.GetSR()
 7 
 8 row0 = result.GetRow(0)
 9 print(row0[0] == 2*3)
10 
11 row1 = result.GetRow(1)
12 print(row1[1] == 2*3)
13 
14 row2 = result.GetRow(2)
15 print(row2[2] == 2*3)

RLPy.RMatrix4.AccuTranslate(self, rkTranslate)

Accumulate matrix with translate vector.

Parameters

rkTranslate[IN] Translate vector - RLPy.RVector3

Returns

Return a new matrix (*this) *= Accumulate - RLPy.RMatrix4

 1 matrix4_orgin = RLPy.RMatrix4()
 2 matrix4_orgin.MakeIdentity()
 3 matrix4_orgin.AccuTranslate(RLPy.RVector3( 1, 2, 3 ) )
 4 matrix4_orgin.AccuTranslate(RLPy.RVector3( 2, 2, 2 ) )
 5 
 6 row3 = matrix4_orgin.GetRow(3)
 7 
 8 print(row3[0] == 1+2)
 9 print(row3[1] == 2+2)
10 print(row3[2] == 2+3)

RLPy.RMatrix4.Adjoint(self)

Inverse times determinant.

Returns

Returns a new matrix containing this matrix's adjoint - RLPy.RMatrix4

 1 matrix4_value = RLPy.RMatrix4( 1, 2, 1, 1,
 2                                1, 1,-1,-2,
 3                                1,-1,-1, 2,
 4                                1,-2, 1,-1 )
 5 
 6 matrix4_Adjoint = matrix4_value.Adjoint()
 7 row0_Adjoint = matrix4_Adjoint.GetRow(0)
 8 
 9 print(row0_Adjoint[0])
10 print(row0_Adjoint[1])
11 print(row0_Adjoint[2])
12 print(row0_Adjoint[3])

RLPy.RMatrix4.AdjointTranspose(self)

Transpose of inverse times determinant.

Returns

Returns a new matrix - RLPy.RMatrix4

 1 matrix4_value = RLPy.RMatrix4( 1, 2, 1, 1,
 2                                1, 1,-1,-2,
 3                                1,-1,-1, 2,
 4                                1,-2, 1,-1 )
 5 
 6 matrix4_Adjoint_transpose = matrix4_value.AdjointTranspose()
 7 col0_Adjoint_transpose = matrix4_Adjoint_transpose.GetColumn(0)
 8 
 9 print(col0_Adjoint_transpose[0] == row0_Adjoint[0])
10 print(col0_Adjoint_transpose[1] == row0_Adjoint[1])
11 print(col0_Adjoint_transpose[2] == row0_Adjoint[2])
12 print(col0_Adjoint_transpose[3] == row0_Adjoint[3])

RLPy.RMatrix4.AlmostSame(self, kM, fThreshold)

compare each element of matrix with threshold(operator= is memory compare)

Parameters

kM[IN] Matrix to compare - RLPy.RMatrix4 fThreshold[IN] Threshold to compare - float

Returns

Return bool - bool

1 # No example

RLPy.RMatrix4.Determinant(self)

The matrix's determinant.

Returns

Returns the determinant of the matrix - float

1 matrix4_value = RLPy.RMatrix4( 1, 2, 1, 1,
2                                1, 1,-1,-2,
3                                1,-1,-1, 2,
4                                1,-2, 1,-1 )
5 
6 print(matrix4_value.Determinant())

RLPy.RMatrix4.E(self, args)

Get the matrix element for the specified index(0~15).

Parameters

nEle[IN] Index of the matrix - int

Returns

Returns the matrix element specified by index - float

1 matrix4 = RLPy.RMatrix4()
2 matrix4.MakeIdentity()
3 print(matrix4.E(0))

RLPy.RMatrix4.FromEulerAngle(self, Oreder, rx, ry, rz)

Rotation matrix from Euler angle.

Parameters

Oreder[IN] Euler order - RLPy.Rotation_Order rx[IN] Angle of x-axis in radians - float ry[IN] Angle of y-axis in radians - float rz[IN] Angle of z-axis in radians - float

Returns

Return a new matrix from specified axis angle - RLPy.RMatrix4

1 # No example

RLPy.RMatrix4.GetColumn(self, nC)

Get the matrix element for the specified column.

Parameters

nC[IN] Index of the column in the matrix - int

Returns

Returns the column vector of the matrix - RLPy.RVector4

1 # No example

RLPy.RMatrix4.GetRow(self, nR)

Get the matrix element for the specified row.

Parameters

nR[IN] Index of the row in the matrix - int

Returns

Returns the row vector of the matrix - RLPy.RVector4

1 matrix4 = RLPy.RMatrix4()
2 matrix4.MakeIdentity()
3 row0 = matrix4.GetRow(0)
4 
5 print(row0[0])
6 print(row0[1])
7 print(row0[2])
8 print(row0[3])

RLPy.RMatrix4.GetSR(self)

Get scale and rotation part of the matrix.

Returns

Return a 3x3 matrix - RLPy.RMatrix3

1 # No example

RLPy.RMatrix4.GetTranslate(self)

Get translate of the matrix.

Returns

Return a translate vector - RLPy.RVector3

1 # No example

RLPy.RMatrix4.InfNorm(self)

InfNorm of the matrix.

Returns

Return InfNorm - float

1 # No example

RLPy.RMatrix4.Inverse(self)

Inverse of the matrix.

Returns

Returns a new matrix containing this matrix's inverse - RLPy.RMatrix4

1 # No example

RLPy.RMatrix4.InverseTranspose(self)

Transpose of inverse.

Returns

Returns a new matrix - RLPy.RMatrix4

 1 matrix4_value = RLPy.RMatrix4( 1, 2, 1, 1,
 2                                1, 1,-1,-2,
 3                                1,-1,-1, 2,
 4                                1,-2, 1,-1 )
 5 
 6 matrix4_inverse_transpose = matrix4_value.InverseTranspose()
 7 col0_inverse_transpose = matrix4_inverse_transpose.GetColumn(0)
 8 
 9 print(col0_inverse_transpose[0] == row0_inverse[0])
10 print(col0_inverse_transpose[1] == row0_inverse[1])
11 print(col0_inverse_transpose[2] == row0_inverse[2])
12 print(col0_inverse_transpose[3] == row0_inverse[3])

RLPy.RMatrix4.M(self, args)

Get the matrix element for the specified row and column.

Parameters

nRow[IN] Index of the row in the matrix - int nCol[IN] Index of the column in the matrix - int

Returns

Returns the matrix element specified by row and col - float

1 matrix4 = RLPy.RMatrix4()
2 matrix4.MakeIdentity()
3 print(matrix4.M(0,0)) #

RLPy.RMatrix4.MakeIdentity(self)

Sets the matrix to the identity.

Returns

this object - RLPy.RMatrix4

1 matrix4 = RLPy.RMatrix4()
2 matrix4.MakeIdentity()

RLPy.RMatrix4.MaxColumn(self)

Get maximum value of the column index in the matrix.

Returns

Return index of column of M containing maximum abs entry, or -1 if M = 0 - int

1 matrix4_column_value = RLPy.RMatrix4( 1, 2, 3,-5,
2                                       0, 0, 0, 0,
3                                       0, 0, 0, 0,
4                                       0, 0, 0, 0 )
5 
6 print(matrix4_column_value.MaxColumn()) # column:3 -> abs(-5)

RLPy.RMatrix4.MaxRow(self)

Get maximum value of the row index in the matrix.

Returns

Return index of row of M containing maximum abs entry, or -1 if M = 0 - int

1 matrix4_row_value = RLPy.RMatrix4( 1, 0, 0, 0,
2                                    2, 0, 0, 0,
3                                    3, 0, 0, 0,
4                                   -5, 0, 0, 0 )
5 
6 print(matrix4_value.MaxRow()) # Row:3 -> abs(-5)

RLPy.RMatrix4.OneNorm(self)

Norm of the matrix.

Returns

Return Norm - float

1 # No example

RLPy.RMatrix4.RotateAxisAngle(self, rkAxis, fAngle)

Rotation matrix from axis angle.

Parameters

rkAxis[IN] axis vector - RLPy.RVector3 fAngle[IN] angle in radians - float

Returns

Return a new matrix from specified axis angle - RLPy.RMatrix4

1 # No example

RLPy.RMatrix4.RotationX(self, fAngle)

Rotation matrix for rotations around x-axis.

Parameters

fAngle[IN] angle in radians - float

Returns

Return a new matrix of for rotations around x-axis - RLPy.RMatrix4

1 # No example

RLPy.RMatrix4.RotationY(self, fAngle)

Rotation matrix for rotations around y-axis.

Parameters

fAngle[IN] angle in radians - float

Returns

Return a new matrix of for rotations around y-axis - RLPy.RMatrix4

1 # No example

RLPy.RMatrix4.RotationZ(self, fAngle)

Rotation matrix for rotations around z-axis.

Parameters

fAngle[IN] angle in radians - float

Returns

Return a new matrix of for rotations around z-axis - RLPy.RMatrix4

1 # No example

RLPy.RMatrix4.SetSR(self, mSR)

Set scale and rotation part of the matrix.

Parameters

mSR[IN] 3x3 matrix - RLPy.RMatrix3

Returns

Return a new 4x4 matrix - RLPy.RMatrix4

1 # No example

RLPy.RMatrix4.SetTranslate(self, vTranslate)

Set translate of the matrix.

Parameters

vTranslate[IN] Translate vector - RLPy.RVector3

Returns

Return a new matrix with the specified translation - RLPy.RMatrix4

1 # No example

RLPy.RMatrix4.TimesTranspose(self, mM)

Multiplies of the transpose of the matrix.

Parameters

mM[IN] the matrix - RLPy.RMatrix4

Returns

Returns a new matrix. (this * M^T) - RLPy.RMatrix4

1 # No example

RLPy.RMatrix4.Transpose(self)

Transpose of the matrix.

Returns

Returns a new matrix containing this matrix's transpose - RLPy.RMatrix4

1 # No example

RLPy.RMatrix4.TransposeTimes(self, mM)

Multiplies of the transpose of the matrix.

Parameters

mM[IN] the matrix - RLPy.RMatrix4

Returns

Returns a new matrix. (this^T * mM) - RLPy.RMatrix4

1 # No example

Description

This class represent the transform data of RTransform. This class provides access to RLPy's internal 4x4 matrix operators and related functions.

Constructor & Destructor

__init__ (self, *args)

The constructor. Initialize a new RMatrix4 with RMatrix4 Item Value.

Parameters

  • args

Member Functions

AccuRotate (self, rkRotate)

Accumulate this 4x4 matrix with rotation matrix.

Parameters

  • rkRotate

AccuScale (self, rkScale)

Accumulate this 4x4 matrix with scale vector.

Parameters

  • rkScale

AccuTranslate (self, rkTranslate)

Accumulate this 4x4 matrix with translate vector.

Parameters

  • rkTranslate

Adjoint (self)

Adjugate this 4x4 matrix.

Sample code

Calls `RLPy.RMatrix4.Adjoint` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_value = RLPy.RMatrix4( 1, 2, 1, 1,
                                   1, 1,-1,-2,
                                   1,-1,-1, 2,
                                   1,-2, 1,-1 )
    matrix4_Adjoint = matrix4_value.Adjoint()
    row0_Adjoint = matrix4_Adjoint.GetRow(0)

    print(row0_Adjoint[0])
    print(row0_Adjoint[1])
    print(row0_Adjoint[2])
    print(row0_Adjoint[3])

AdjointTranspose (self)

Adjugate and transpose this 4x4 matrix.

Sample code

Calls `RLPy.RMatrix4.AdjointTranspose` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_value = RLPy.RMatrix4( 1, 2, 1, 1,
                                   1, 1,-1,-2,
                                   1,-1,-1, 2,
                                   1,-2, 1,-1 )
    matrix4_Adjoint_transpose = matrix4_value.AdjointTranspose()
    col0_Adjoint_transpose = matrix4_Adjoint_transpose.GetColumn(0)

    print(col0_Adjoint_transpose[0] == row0_Adjoint[0])
    print(col0_Adjoint_transpose[1] == row0_Adjoint[1])
    print(col0_Adjoint_transpose[2] == row0_Adjoint[2])
    print(col0_Adjoint_transpose[3] == row0_Adjoint[3])

AlmostSame (self, kM, fThreshold)

Reports whether this matrix is approximately equal to another matrix.

Parameters

  • kM
  • fThreshold

Determinant (self)

Obtain the scalar value for this 4x4 matrix (|A|). File:Rlpy_rmatrix4_determinant.jpg

Sample code

Calls `RLPy.RMatrix4.Determinant` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_value = RLPy.RMatrix4( 1, 2, 1, 1,
                                   1, 1,-1,-2,
                                   1,-1,-1, 2,
                                   1,-2, 1,-1 )
    print(matrix4_value.Determinant())

E (self, *args)

Get the value of an element in a 3x3 matrix by index number (from 0 to 15);

Parameters

  • args

Sample code

Calls `RLPy.RMatrix4.E` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4 = RLPy.RMatrix4()
    matrix4.MakeIdentity()

    print(matrix4.E(0)) #

FromEulerAngle (self, Oreder, rx, ry, rz)

Convert Euler angle to a 4x4 matrix according to a rotation axis order.

Parameters

  • Oreder
  • rx
  • ry
  • rz

FromRTS (self, kRotate, kTranslate, kScale)

Apply rotate, translate, and scale data to a 4x4 matrix.

Parameters

  • kRotate
  • kTranslate
  • kScale

GetColumn (self, nC)

Retrieve a column inside a 4x4 matrix.

Parameters

  • nC

Sample code

Calls `RLPy.RMatrix4.GetColumn` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4 = RLPy.RMatrix4()
    matrix4.MakeIdentity()
    col0 = matrix4.GetColumn(0)

    print(col0[0])
    print(col0[1])
    print(col0[2])
    print(col0[3])

Sample code

Calls `RLPy.RMatrix4.TimesTranspose` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_orgin = RLPy.RMatrix4(  1,  2,  3,  4,
                                    5,  6,  7,  8,
                                    9, 10, 11, 12,
                                   13, 14, 15, 16 )
    matrix4_transpose_value = RLPy.RMatrix4( 3, 0, 0, 0,
                                             0, 3, 0, 0,
                                             0, 0, 3, 0,
                                             0, 0, 0, 3 )
    matrix4_times_transpose = matrix4_orgin.TimesTranspose(matrix4_transpose_value)
    row0 = matrix4_orgin.GetColumn(0)
    col0 = matrix4_times_transpose.GetColumn(0)

    print(row0[0]*3 == col0[0])
    print(row0[1]*3 == col0[1])
    print(row0[2]*3 == col0[2])
    print(row0[3]*3 == col0[3])

GetRow (self, nR)

Retreive a row inside a 4x4 matrix.

Parameters

  • nR

Sample code

Calls `RLPy.RMatrix4.TransposeTimes` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_orgin = RLPy.RMatrix4(  1,  2,  3,  4,
                                    5,  6,  7,  8,
                                    9, 10, 11, 12,
                                   13, 14, 15, 16 )
    matrix4_transpose_value = RLPy.RMatrix4( 2, 0, 0, 0,
                                             0, 2, 0, 0,
                                             0, 0, 2, 0,
                                             0, 0, 0, 2 )
    matrix4_transpose_times = matrix4_orgin.TransposeTimes(matrix4_transpose_value)
    row0 = matrix4_orgin.GetRow(0)
    col0 = matrix4_transpose_times.GetColumn(0)

    print(row0[0]*2 == col0[0])
    print(row0[1]*2 == col0[1])
    print(row0[2]*2 == col0[2])
    print(row0[3]*2 == col0[3])

Sample code

Calls `RLPy.RMatrix4.GetRow` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4 = RLPy.RMatrix4()
    matrix4.MakeIdentity()
    row0 = matrix4.GetRow(0)

    print(row0[0])
    print(row0[1])
    print(row0[2])
    print(row0[3])

Sample code

Calls `RLPy.RMatrix4.Transpose` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_orgin = RLPy.RMatrix4(  1,  2,  3,  4,
                                    5,  6,  7,  8,
                                    9, 10, 11, 12,
                                   13, 14, 15, 16 )
    matrix4_transpose = matrix4_orgin.Transpose()
    row0 = matrix4_orgin.GetRow(0)
    col0 = matrix4_transpose.GetColumn(0)

    print(row0[0] == col0[0])
    print(row0[1] == col0[1])
    print(row0[2] == col0[2])
    print(row0[3] == col0[3])

GetSR (self)

Get scale and rotation part of the matrix.

GetSimpleRTS (self, rkRotate, rkTranslate, rkScale)

Retrieve rotation, translation, and scale data from this 4x4 matrix.

Parameters

  • rkRotate
  • rkTranslate
  • rkScale

GetSimpleRotate (self, rkRotate)

Retrieve rotation data from this 4x4 matrix.

Parameters

  • rkRotate

GetTranslate (self)

Get translate of the matrix.

InfNorm (self)

Return the sum of the row elements that contain the largest absolute values.

Sample code

Calls `RLPy.RMatrix4.InfNorm` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_column_value = RLPy.RMatrix4( 1, 2, 3,-5,
                                          0, 0, 0, 0,
                                          0, 0, 0, 0,
                                          0, 0, 0, 0 )
    print(matrix4_column_value.InfNorm()) # 11 -> 1+2+abs(-5)

Inverse (self)

Obtain the inverse (reciprocal) of this 4x4 matrix (A^-1).

Sample code

Calls `RLPy.RMatrix4.Inverse` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_value = RLPy.RMatrix4( 1, 2, 1, 1,
                                   1, 1,-1,-2,
                                   1,-1,-1, 2,
                                   1,-2, 1,-1 )
    matrix4_inverse = matrix4_value.Inverse()
    row0_inverse = matrix4_inverse.GetRow(0)

    print(row0_inverse[0])
    print(row0_inverse[1])
    print(row0_inverse[2])
    print(row0_inverse[3])

InverseTranspose (self)

Invert and transpose this 4x4 matrix.

Sample code

Calls `RLPy.RMatrix4.InverseTranspose` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_value = RLPy.RMatrix4( 1, 2, 1, 1,
                                   1, 1,-1,-2,
                                   1,-1,-1, 2,
                                   1,-2, 1,-1 )
    matrix4_inverse_transpose = matrix4_value.InverseTranspose()
    col0_inverse_transpose = matrix4_inverse_transpose.GetColumn(0)

    print(col0_inverse_transpose[0] == row0_inverse[0])
    print(col0_inverse_transpose[1] == row0_inverse[1])
    print(col0_inverse_transpose[2] == row0_inverse[2])
    print(col0_inverse_transpose[3] == row0_inverse[3])

M (self, *args)

Get the value of an element in a 4x4 matrix by row and column index.

Parameters

  • args

Sample code

Calls `RLPy.RMatrix4.M` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4 = RLPy.RMatrix4()
    matrix4.MakeIdentity()

    print(matrix4.M(0,0)) #

MakeIdentity (self)

This function can be used to initialize the 3x3 matrix. It is equivalent to setting the matrix to: [1 0 0 0] [0 1 0 0] [0 0 1 0] [0 0 0 1]

Sample code

Calls `RLPy.RMatrix4.M` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4 = RLPy.RMatrix4()
    matrix4.MakeIdentity()

    print(matrix4.M(0,0)) #

Sample code

Calls `RLPy.RMatrix4.GetColumn` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4 = RLPy.RMatrix4()
    matrix4.MakeIdentity()
    col0 = matrix4.GetColumn(0)

    print(col0[0])
    print(col0[1])
    print(col0[2])
    print(col0[3])

Sample code

Calls `RLPy.RMatrix4.GetRow` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4 = RLPy.RMatrix4()
    matrix4.MakeIdentity()
    row0 = matrix4.GetRow(0)

    print(row0[0])
    print(row0[1])
    print(row0[2])
    print(row0[3])

Sample code

Calls `RLPy.RMatrix4.E` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4 = RLPy.RMatrix4()
    matrix4.MakeIdentity()

    print(matrix4.E(0)) #

Sample code

Calls `RLPy.RMatrix4.MakeIdentity` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4 = RLPy.RMatrix4()
    matrix4.MakeIdentity()

MaxColumn (self)

Find the maximum absolute value within this 4x4 matrix, and return the column in which the value is located. If all of the elements within the 4x4 matrix are 0 then return -1.

Sample code

Calls `RLPy.RMatrix4.MaxColumn` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_column_value = RLPy.RMatrix4( 1, 2, 3,-5,
                                          0, 0, 0, 0,
                                          0, 0, 0, 0,
                                          0, 0, 0, 0 )
    print(matrix4_column_value.MaxColumn()) # column:3 -> abs(-5)

MaxRow (self)

Find the maximum absolute value within this 4x4 matrix, and return the row in which the value is located. If all of the elements within the 4x4 matrix are 0 then return -1.

OneNorm (self)

Return the sum of the column elements that contain the largest absolute values.

Sample code

Calls `RLPy.RMatrix4.OneNorm` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_row_value = RLPy.RMatrix4( 1, 0, 0, 0,
                                       2, 0, 0, 0,
                                       3, 0, 0, 0,
                                      -5, 0, 0, 0 )
    print(matrix4_row_value.OneNorm()) # 11 -> 1+2+abs(-5)

RotateAxisAngle (self, rkAxis, fAngle)

Rotation matrix from axis angle.

Parameters

  • rkAxis
  • fAngle

RotationX (self, fAngle)

Rotation matrix for rotations around x-axis.

Parameters

  • fAngle

RotationY (self, fAngle)

Rotation matrix for rotations around y-axis.

Parameters

  • fAngle

RotationZ (self, fAngle)

Rotation matrix for rotations around z-axis.

Parameters

  • fAngle

SetSR (self, mSR)

Set scale and rotation part of the matrix.

Parameters

  • mSR

SetTranslate (self, vTranslate)

Set translate of the matrix.

Parameters

  • vTranslate

SetTranslateZero (self)

Set the translation data in this 4x4 matrix to 0.

TimesTranspose (self, mM)

Multiply this 4x4 matrix with a transposed version of itself.

Parameters

  • mM

Sample code

Calls `RLPy.RMatrix4.TimesTranspose` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_orgin = RLPy.RMatrix4(  1,  2,  3,  4,
                                    5,  6,  7,  8,
                                    9, 10, 11, 12,
                                   13, 14, 15, 16 )
    matrix4_transpose_value = RLPy.RMatrix4( 3, 0, 0, 0,
                                             0, 3, 0, 0,
                                             0, 0, 3, 0,
                                             0, 0, 0, 3 )
    matrix4_times_transpose = matrix4_orgin.TimesTranspose(matrix4_transpose_value)
    row0 = matrix4_orgin.GetColumn(0)
    col0 = matrix4_times_transpose.GetColumn(0)

    print(row0[0]*3 == col0[0])
    print(row0[1]*3 == col0[1])
    print(row0[2]*3 == col0[2])
    print(row0[3]*3 == col0[3])

Transpose (self)

Obtain the transposed matrix by transposing the current m * n matrix into an n * m matrix by row-column swapping.

Sample code

Calls `RLPy.RMatrix4.Transpose` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_orgin = RLPy.RMatrix4(  1,  2,  3,  4,
                                    5,  6,  7,  8,
                                    9, 10, 11, 12,
                                   13, 14, 15, 16 )
    matrix4_transpose = matrix4_orgin.Transpose()
    row0 = matrix4_orgin.GetRow(0)
    col0 = matrix4_transpose.GetColumn(0)

    print(row0[0] == col0[0])
    print(row0[1] == col0[1])
    print(row0[2] == col0[2])
    print(row0[3] == col0[3])

TransposeTimes (self, mM)

Multiply a transposed version of a 4x4 matrix with itself.

Parameters

  • mM

Sample code

Calls `RLPy.RMatrix4.TransposeTimes` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_orgin = RLPy.RMatrix4(  1,  2,  3,  4,
                                    5,  6,  7,  8,
                                    9, 10, 11, 12,
                                   13, 14, 15, 16 )
    matrix4_transpose_value = RLPy.RMatrix4( 2, 0, 0, 0,
                                             0, 2, 0, 0,
                                             0, 0, 2, 0,
                                             0, 0, 0, 2 )
    matrix4_transpose_times = matrix4_orgin.TransposeTimes(matrix4_transpose_value)
    row0 = matrix4_orgin.GetRow(0)
    col0 = matrix4_transpose_times.GetColumn(0)

    print(row0[0]*2 == col0[0])
    print(row0[1]*2 == col0[1])
    print(row0[2]*2 == col0[2])
    print(row0[3]*2 == col0[3])

__add__ (self, mM)

The "addition" operator. See Also: +=

Parameters

  • mM

Sample code

Calls `RLPy.RMatrix4.__add__` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_a = RLPy.RMatrix4( 1, 2, 3, 4,
                               0, 0, 0, 0,
                               0, 0, 0, 0,
                               0, 0, 0, 0 )
    matrix4_b = RLPy.RMatrix4( 2, 2, 2, 2,
                               0, 0, 0, 0,
                               0, 0, 0, 0,
                               0, 0, 0, 0 )
    matrix4_result = matrix4_a + matrix4_b

    print( matrix4_result.GetRow(0)[0] == 1+2 ) # true
    print( matrix4_result.GetRow(0)[1] == 2+2 ) # true
    print( matrix4_result.GetRow(0)[2] == 3+2 ) # true
    print( matrix4_result.GetRow(0)[3] == 4+2 ) # true

__eq__ (self, mM)

The "equal to" operator. Performs a one-by-one comparison of the matrix array. See Also: !=

Parameters

  • mM

__ge__ (self, mM)

Reports whether this value is greater than or equal to another value.

Parameters

  • mM

__gt__ (self, mM)

Reports whether this value is greater than another value.

Parameters

  • mM

__iadd__ (self, mM)

Adds another value to this value in place.

Parameters

  • mM

__imul__ (self, *args)

Multiplies this value by another value in place.

Parameters

  • args

__isub__ (self, mM)

Subtracts another value from this value in place.

Parameters

  • mM

__itruediv__ (self, *args)

Divides this value by another value in place.

Parameters

  • args

__le__ (self, mM)

Reports whether this value is less than or equal to another value.

Parameters

  • mM

__lt__ (self, mM)

Reports whether this value is less than another value.

Parameters

  • mM

__mul__ (self, *args)

The "multiplication" operator. See Also: *=

Parameters

  • args

Sample code

Calls `RLPy.RMatrix4.__mul__` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_a = RLPy.RMatrix4( 1, 2, 3, 4,
                               0, 0, 0, 0,
                               0, 0, 0, 0,
                               0, 0, 0, 0 )
    matrix4_b = RLPy.RMatrix4( 2, 0, 0, 0,
                               2, 0, 0, 0,
                               2, 0, 0, 0,
                               2, 0, 0, 0 )
    matrix4_result = matrix4_a * matrix4_b

    print( matrix4_result.GetRow(0)[0] == 1*2 + 2*2 + 3*2 + 4*2  ) # true

__ne__ (self, mM)

The "not equal to" operator. Performs a one-by-one comparison of the matrix array. See Also: ==

Parameters

  • mM

__neg__ (self)

Returns the negated value.

__sub__ (self, mM)

The "subtraction" operator. See Also: -=

Parameters

  • mM

Sample code

Calls `RLPy.RMatrix4.__sub__` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_a = RLPy.RMatrix4( 1, 2, 3, 4,
                               0, 0, 0, 0,
                               0, 0, 0, 0,
                               0, 0, 0, 0 )
    matrix4_b = RLPy.RMatrix4( 2, 2, 2, 2,
                               0, 0, 0, 0,
                               0, 0, 0, 0,
                               0, 0, 0, 0 )
    matrix4_result = matrix4_a - matrix4_b

    print( matrix4_result.GetRow(0)[0] == 1-2 ) # true
    print( matrix4_result.GetRow(0)[1] == 2-2 ) # true
    print( matrix4_result.GetRow(0)[2] == 3-2 ) # true
    print( matrix4_result.GetRow(0)[3] == 4-2 ) # true

__truediv__ (self, *args)

The "division" operator. See Also: /=

Parameters

  • args

Sample code

Calls `RLPy.RMatrix4.__truediv__` with the inputs shown in the example.

def run_script():
    import RLPy
    matrix4_a = RLPy.RMatrix4( 1, 2, 3, 4,
                               0, 0, 0, 0,
                               0, 0, 0, 0,
                               0, 0, 0, 0 )
    matrix4_result = matrix4_a / 2

    print( matrix4_result.GetRow(0)[0] == 1/2 ) # true
    print( matrix4_result.GetRow(0)[1] == 2/2 ) # true
    print( matrix4_result.GetRow(0)[2] == 3/2 ) # true
    print( matrix4_result.GetRow(0)[3] == 4/2 ) # true

Properties

thisown

Indicates whether this SWIG proxy owns the underlying C++ object.

Constants

COUNT

DIMENSION

IDENTITY (*args)

Parameters

  • args

ZERO (*args)

Parameters

  • args