vray.Matrix¶
- class vray.Matrix¶
Bases:
object
A 3x3 column-major matrix. Each column is a vray.Vector that can be indexed. The usual mathematical operations are supported as well as equality checks. This object is immutable.
Matrix() -> new Matrix initialized to all zeroes
Matrix(diagonal) -> new Matrix initialized with ‘diagonal’ along the diagonal
Matrix(col0, col1, col2) -> new Matrix initialized with the 3 vray.Vector-s
Attributes
Column0 of the matrix
Column1 of the matrix
Column2 of the matrix
Methods
__init__
()Gets a copy of the matrix with added diagonal
Gets a copy of the matrix with added another matrix transposed.
Compute the inverse of a matrix.
Creates a rotational matrix around the x axis given an angle in radians.
Creates a rotational matrix around the y axis given an angle in radians.
Creates a rotational matrix around the z axis given an angle in radians.
Get a orthogonal copy of the matrix(each column vector is orthogonal to the other two in 3D space).
Get a orthonormal copy of the matrix
Gets an outer product matrix of the two given vray.Vector-s.
Get a copy of the matrix with changed column.
Get a copy of the matrix with changed row.
Get a copy of this matrix rotated around the given axis.
Get a transposed copy of the matrix.
Get the copy of the matrix with normalised columns.
- addDiagonal()¶
Gets a copy of the matrix with added diagonal
diag - New vector value
- addTransposed()¶
Gets a copy of the matrix with added another matrix transposed.
matrix - Another matrix to transpose and add
- inverse()¶
Compute the inverse of a matrix.
- static makeRotationMatrixX()¶
Creates a rotational matrix around the x axis given an angle in radians.
- static makeRotationMatrixY()¶
Creates a rotational matrix around the y axis given an angle in radians.
- static makeRotationMatrixZ()¶
Creates a rotational matrix around the z axis given an angle in radians.
- orthogonal()¶
Get a orthogonal copy of the matrix(each column vector is orthogonal to the other two in 3D space).
- orthonormal()¶
Get a orthonormal copy of the matrix
- static outerProduct()¶
Gets an outer product matrix of the two given vray.Vector-s.
- replaceColumn()¶
Get a copy of the matrix with changed column.
index - Column index to be changed.
vector - New vector value
- replaceRow()¶
Get a copy of the matrix with changed row.
index - Row index to be changed.
vector - New vector value
- rotate()¶
Get a copy of this matrix rotated around the given axis.
axis - An axis vector to rotate around. The length of the axis is the tangent of the angle of rotation.
- transpose()¶
Get a transposed copy of the matrix.
- withoutScale()¶
Get the copy of the matrix with normalised columns. This effectively removes scaling from a transform matrix.
- column0¶
Column0 of the matrix
- column1¶
Column1 of the matrix
- column2¶
Column2 of the matrix
- identity = Matrix(Vector(1, 0, 0), Vector(0, 1, 0), Vector(0, 0, 1))¶
- zero = Matrix(Vector(0, 0, 0), Vector(0, 0, 0), Vector(0, 0, 0))¶