osg.Matrix

class osg.Matrix
Represents:c++ class
Wraps:osg::Matrixd

Constructors:

osg.Matrix()

osg.Matrix(osg.Matrix v)

Параметры:v (osg.Matrix) –
osg.Matrix(osg.RefMatrix v)

Параметры: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)

Параметры:
  • 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) –

Methods:

:transpose(osg.Matrix rhs)

Параметры:rhs (osg.Matrix) –
Тип результата:bool
:setTrans(osg.Vec3 trans)

Параметры:trans (osg.Vec3) –
:getTrans()

Тип результата:osg.Vec3
:setRotate(osg.Quat rot)

Параметры:rot (osg.Quat) –
:getRotate()

Get the matrix rotation as a osg.Quat. Note that this function assumes a non-scaled osg.Matrix and will return incorrect results for scaled matrixces. Consider osg.Matrix.decompose() instead.

Тип результата:osg.Quat
:getScale()

Тип результата:osg.Vec3
:preMult(osg.Matrix matrix)

Параметры:matrix (osg.Matrix) –
:postMult(osg.Matrix matrix)

Параметры:matrix (osg.Matrix) –
:getItem(unsigned row, unsigned column)

Параметры:
  • row (unsigned) –
  • column (unsigned) –
Тип результата:

double

:setItem(unsigned row, unsigned column, double val)

Параметры:
  • row (unsigned) –
  • column (unsigned) –
  • val (double) –
:decompose()

Decompose the matrix into translation, rotation, scale and scale orientation.

:getPerspective()

Get the frustum settings of a symmetric perspective projection matrix. Return false if 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).

Параметры:
:isNaN()

Тип результата:bool
:identity()

:isIdentity()

Тип результата:bool

Static Methods:

.identity()

Тип результата:osg.Matrix
.rotate(double angle, double x, double y, double z)

Параметры:
  • angle (double) –
  • x (double) –
  • y (double) –
  • z (double) –
Тип результата:

osg.Matrix

.rotate(double angle, osg.Vec3 vector)

Параметры:
  • angle (double) –
  • vector (osg.Vec3) –
Тип результата:

osg.Matrix

.rotate(osg.Quat rot)

Параметры:rot (osg.Quat) –
Тип результата:osg.Matrix
.translate(double x, double y, double z)

Параметры:
  • x (double) –
  • y (double) –
  • z (double) –
Тип результата:

osg.Matrix

.translate(osg.Vec3 trans)

Параметры:trans (osg.Vec3) –
Тип результата:osg.Matrix
.scale(double x, double y, double z)

Параметры:
  • x (double) –
  • y (double) –
  • z (double) –
Тип результата:

osg.Matrix

.scale(osg.Vec3 scale)

Параметры:scale (osg.Vec3) –
Тип результата:osg.Matrix
.inverse(osg.Matrix matrix)

Параметры:matrix (osg.Matrix) –
Тип результата: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).

Параметры:
Тип результата:

osg.Matrix

.transform3x3(osg.Vec3 vec, osg.Matrix matrix)

Параметры:
Тип результата:

osg.Vec3

.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.

Параметры:
  • left (double) –
  • right (double) –
  • bottom (double) –
  • top (double) –
  • zNear (double) –
  • zFar (double) –
Тип результата:

osg.Matrix

.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.

Параметры:
  • left (double) –
  • right (double) –
  • bottom (double) –
  • top (double) –
Тип результата:

osg.Matrix

.perspective(double fovy, double aspectRatio, double zNear, double zFar)

Параметры:
  • fovy (double) –
  • aspectRatio (double) –
  • zNear (double) –
  • zFar (double) –
Тип результата:

osg.Matrix