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:
- :getRotate()¶
Get the matrix rotation as a
osg.Quat
. Note that this function assumes a non-scaledosg.Matrix
and will return incorrect results for scaled matrixces. Considerosg.Matrix.decompose()
instead.- Тип результата
- :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()
-
- Тип результата
- .rotate(double angle, double x, double y, double z)¶
-
- Параметры
angle (
double
) –x (
double
) –y (
double
) –z (
double
) –
- Тип результата
- .rotate(double angle, osg.Vec3 vector)
-
- Параметры
angle (
double
) –vector (
osg.Vec3
) –
- Тип результата
- .rotate(osg.Quat rot)
-
- Параметры
rot (
osg.Quat
) –- Тип результата
- .translate(double x, double y, double z)¶
-
- Параметры
x (
double
) –y (
double
) –z (
double
) –
- Тип результата
- .translate(osg.Vec3 trans)
-
- Параметры
trans (
osg.Vec3
) –- Тип результата
- .scale(double x, double y, double z)¶
-
- Параметры
x (
double
) –y (
double
) –z (
double
) –
- Тип результата
- .scale(osg.Vec3 scale)
-
- Параметры
scale (
osg.Vec3
) –- Тип результата
- .inverse(osg.Matrix matrix)¶
-
- Параметры
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).- Параметры
- Тип результата
- .transform3x3(osg.Vec3 vec, osg.Matrix matrix)¶
-
- Параметры
vec (
osg.Vec3
) –matrix (
osg.Matrix
) –
- Тип результата
- .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
) –
- Тип результата
- .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
) –
- Тип результата
- .perspective(double fovy, double aspectRatio, double zNear, double zFar)¶
-
- Параметры
fovy (
double
) –aspectRatio (
double
) –zNear (
double
) –zFar (
double
) –
- Тип результата