osg.Matrix¶
-
class
osg.Matrix¶ Represents: c++ class Wraps: osg::Matrixd Constructors:
-
osg.Matrix()¶
-
osg.Matrix(osg.Matrix v) -
Parameters: v ( osg.Matrix) –
-
osg.Matrix(osg.RefMatrix v) -
Parameters: v ( osg.RefMatrix) –
-
osg.Matrix(double a00, double a01, double a02, double a03, double a10, double a11, double a12, double a13, double a20, double a21, double a22, double a23, double a30, double a31, double a32, double a33) -
Parameters: - a00 (
double) – - a01 (
double) – - a02 (
double) – - a03 (
double) – - a10 (
double) – - a11 (
double) – - a12 (
double) – - a13 (
double) – - a20 (
double) – - a21 (
double) – - a22 (
double) – - a23 (
double) – - a30 (
double) – - a31 (
double) – - a32 (
double) – - a33 (
double) –
- a00 (
Methods:
-
:
transpose(osg.Matrix rhs)¶ -
Parameters: rhs ( osg.Matrix) –Return type: bool
-
:
getRotate()¶ Get the matrix rotation as a
osg.Quat. Note that this function assumes a non-scaledosg.Matrixand will return incorrect results for scaled matrixces. Considerosg.Matrix.decompose()instead.Return type: osg.Quat
-
:
preMult(osg.Matrix matrix)¶ -
Parameters: matrix ( osg.Matrix) –
-
:
postMult(osg.Matrix matrix)¶ -
Parameters: matrix ( osg.Matrix) –
-
:
getItem(unsigned row, unsigned column)¶ -
Parameters: - row (
unsigned) – - column (
unsigned) –
Return type: double - row (
-
:
setItem(unsigned row, unsigned column, double val)¶ -
Parameters: - row (
unsigned) – - column (
unsigned) – - val (
double) –
- row (
-
:
decompose()¶ Decompose the matrix into translation, rotation, scale and scale orientation.
-
:
getPerspective()¶ Get the frustum settings of a symmetric perspective projection matrix. Return
falseif matrix is not a perspective matrix, where parameter values are undefined. Note, if matrix is not a symmetric perspective matrix then the shear will be lost. Asymmetric matrices occur when stereo, power walls, caves and reality center display are used. In these configuration one should use the AsFrustum method instead.
-
:
makeLookAt(osg.Vec3 eye, osg.Vec3 center, osg.Vec3 up)¶ Set the position and orientation to be a view matrix, using the same convention as
gluLookAt(https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluLookAt.xml).Parameters:
-
:
isNaN()¶ -
Return type: bool
-
:
identity()¶
-
:
isIdentity()¶ -
Return type: bool
Static Methods:
-
.
identity() -
Return type: osg.Matrix
-
.
rotate(double angle, double x, double y, double z)¶ -
Parameters: - angle (
double) – - x (
double) – - y (
double) – - z (
double) –
Return type: - angle (
-
.
rotate(double angle, osg.Vec3 vector) -
Parameters: - angle (
double) – - vector (
osg.Vec3) –
Return type: - angle (
-
.
rotate(osg.Quat rot) -
Parameters: rot ( osg.Quat) –Return type: osg.Matrix
-
.
translate(double x, double y, double z)¶ -
Parameters: - x (
double) – - y (
double) – - z (
double) –
Return type: - x (
-
.
translate(osg.Vec3 trans) -
Parameters: trans ( osg.Vec3) –Return type: osg.Matrix
-
.
scale(double x, double y, double z)¶ -
Parameters: - x (
double) – - y (
double) – - z (
double) –
Return type: - x (
-
.
scale(osg.Vec3 scale) -
Parameters: scale ( osg.Vec3) –Return type: osg.Matrix
-
.
inverse(osg.Matrix matrix)¶ -
Parameters: matrix ( osg.Matrix) –Return type: osg.Matrix
-
.
lookAt(osg.Vec3 eye, osg.Vec3 center, osg.Vec3 up)¶ Create the position and orientation as per a camera, using the same convention as
gluLookAt(https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluLookAt.xml).Parameters: Return type:
-
.
transform3x3(osg.Vec3 vec, osg.Matrix matrix)¶ -
Parameters: - vec (
osg.Vec3) – - matrix (
osg.Matrix) –
Return type: - vec (
-
.
ortho(double left, double right, double bottom, double top, double zNear, double zFar)¶ Create an orthographic projection matrix. See
glOrtho(https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glOrtho.xml) for further details.Parameters: - left (
double) – - right (
double) – - bottom (
double) – - top (
double) – - zNear (
double) – - zFar (
double) –
Return type: - left (
-
.
ortho2D(double left, double right, double bottom, double top)¶ Create a 2D orthographic projection. See
glOrtho(https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glOrtho.xml) for further details.Parameters: - left (
double) – - right (
double) – - bottom (
double) – - top (
double) –
Return type: - left (
-
.
perspective(double fovy, double aspectRatio, double zNear, double zFar)¶ -
Parameters: - fovy (
double) – - aspectRatio (
double) – - zNear (
double) – - zFar (
double) –
Return type: - fovy (
-