Note
This class was introduced in Qt 4.6
The PySide.QtGui.QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
See also
PySide.QtGui.QVector3D QGenericMatrix
Parameters: |
|
---|
Constructs an identity matrix.
Constructs a 4x4 matrix from a conventional Qt 2D affine transformation matrix .
If matrix has a special type (identity, translate, scale, etc), the programmer should follow this constructor with a call to PySide.QtGui.QMatrix4x4.optimize() if they wish PySide.QtGui.QMatrix4x4 to optimize further calls to PySide.QtGui.QMatrix4x4.translate() , PySide.QtGui.QMatrix4x4.scale() , etc.
Constructs a 4x4 matrix from the conventional Qt 2D transformation matrix transform .
If transform has a special type (identity, translate, scale, etc), the programmer should follow this constructor with a call to PySide.QtGui.QMatrix4x4.optimize() if they wish PySide.QtGui.QMatrix4x4 to optimize further calls to PySide.QtGui.QMatrix4x4.translate() , PySide.QtGui.QMatrix4x4.scale() , etc.
Constructs a matrix from the given 16 floating-point values . The contents of the array values is assumed to be in row-major order.
If the matrix has a special type (identity, translate, scale, etc), the programmer should follow this constructor with a call to PySide.QtGui.QMatrix4x4.optimize() if they wish PySide.QtGui.QMatrix4x4 to optimize further calls to PySide.QtGui.QMatrix4x4.translate() , PySide.QtGui.QMatrix4x4.scale() , etc.
Constructs a matrix from the 16 elements m11 , m12 , m13 , m14 , m21 , m22 , m23 , m24 , m31 , m32 , m33 , m34 , m41 , m42 , m43 , and m44 . The elements are specified in row-major order.
If the matrix has a special type (identity, translate, scale, etc), the programmer should follow this constructor with a call to PySide.QtGui.QMatrix4x4.optimize() if they wish PySide.QtGui.QMatrix4x4 to optimize further calls to PySide.QtGui.QMatrix4x4.translate() , PySide.QtGui.QMatrix4x4.scale() , etc.
See also
Return type: | PyObject |
---|
Return type: | PyObject |
---|
Return type: | PyObject |
---|
Parameters: | index – PySide.QtCore.int |
---|---|
Return type: | PySide.QtGui.QVector4D |
Returns the elements of column index as a 4D vector.
Retrieves the 16 items in this matrix and copies them to values in row-major order.
Return type: | PySide.QtCore.qreal |
---|
Returns the determinant of this matrix.
Parameters: | value – PySide.QtCore.qreal |
---|
Fills all elements of this matrx with value .
Flips between right-handed and left-handed coordinate systems by multiplying the y and z co-ordinates by -1. This is normally used to create a left-handed orthographic view without scaling the viewport as PySide.QtGui.QMatrix4x4.ortho() does.
See also
Parameters: |
|
---|
Multiplies this matrix by another that applies a perspective frustum projection for a window with lower-left corner (left , bottom ), upper-right corner (right , top ), and the specified nearPlane and farPlane clipping planes.
Parameters: | invertible – PySide.QtCore.bool |
---|---|
Return type: | PySide.QtGui.QMatrix4x4 |
Returns the inverse of this matrix. Returns the identity if this matrix cannot be inverted; i.e. PySide.QtGui.QMatrix4x4.determinant() is zero. If invertible is not null, then true will be written to that location if the matrix can be inverted; false otherwise.
If the matrix is recognized as the identity or an orthonormal matrix, then this function will quickly invert the matrix using optimized routines.
Return type: | PySide.QtCore.bool |
---|
Returns true if this matrix is the identity; false otherwise.
Parameters: |
|
---|
Multiplies this matrix by another that applies an eye position transformation. The center value indicates the center of the view that the eye is looking at. The up value indicates which direction should be considered up with respect to the eye .
Parameters: | point – PySide.QtGui.QVector4D |
---|---|
Return type: | PySide.QtGui.QVector4D |
Maps point by multiplying this matrix by point .
See also
Parameters: | point – PySide.QtGui.QVector3D |
---|---|
Return type: | PySide.QtGui.QVector3D |
Maps point by multiplying this matrix by point .
Parameters: | point – PySide.QtCore.QPoint |
---|---|
Return type: | PySide.QtCore.QPoint |
Maps point by multiplying this matrix by point .
See also
Parameters: | point – PySide.QtCore.QPointF |
---|---|
Return type: | PySide.QtCore.QPointF |
Maps point by multiplying this matrix by point .
See also
Parameters: | rect – PySide.QtCore.QRectF |
---|---|
Return type: | PySide.QtCore.QRectF |
Maps rect by multiplying this matrix by the corners of rect and then forming a new rectangle from the results. The returned rectangle will be an ordinary 2D rectangle with sides parallel to the horizontal and vertical axes.
See also
Parameters: | rect – PySide.QtCore.QRect |
---|---|
Return type: | PySide.QtCore.QRect |
Maps rect by multiplying this matrix by the corners of rect and then forming a new rectangle from the results. The returned rectangle will be an ordinary 2D rectangle with sides parallel to the horizontal and vertical axes.
See also
Parameters: | vector – PySide.QtGui.QVector3D |
---|---|
Return type: | PySide.QtGui.QVector3D |
Maps vector by multiplying the top 3x3 portion of this matrix by vector . The translation and projection components of this matrix are ignored.
See also
Return type: | PySide.QtGui.QMatrix3x3 |
---|
Returns the normal matrix corresponding to this 4x4 transformation. The normal matrix is the transpose of the inverse of the top-left 3x3 part of this 4x4 matrix. If the 3x3 sub-matrix is not invertible, this function returns the identity.
See also
Parameters: | other – PySide.QtGui.QMatrix4x4 |
---|---|
Return type: | PySide.QtCore.bool |
Returns true if this matrix is not identical to other ; false otherwise. This operator uses an exact floating-point comparison.
Parameters: | factor – PySide.QtCore.qreal |
---|---|
Return type: | PySide.QtGui.QMatrix4x4 |
Parameters: | factor – PySide.QtCore.qreal |
---|---|
Return type: | PySide.QtGui.QMatrix4x4 |
Parameters: | m2 – PySide.QtGui.QMatrix4x4 |
---|---|
Return type: | PySide.QtGui.QMatrix4x4 |
Parameters: | factor – PySide.QtCore.qreal |
---|---|
Return type: | PySide.QtGui.QMatrix4x4 |
This is an overloaded function.
Multiplies all elements of this matrix by factor .
Parameters: | other – PySide.QtGui.QMatrix4x4 |
---|---|
Return type: | PySide.QtGui.QMatrix4x4 |
Multiplies the contents of other by this matrix.
Parameters: | m2 – PySide.QtGui.QMatrix4x4 |
---|---|
Return type: | PySide.QtGui.QMatrix4x4 |
Parameters: | other – PySide.QtGui.QMatrix4x4 |
---|---|
Return type: | PySide.QtGui.QMatrix4x4 |
Adds the contents of other to this matrix.
Return type: | PySide.QtGui.QMatrix4x4 |
---|
Parameters: | m2 – PySide.QtGui.QMatrix4x4 |
---|---|
Return type: | PySide.QtGui.QMatrix4x4 |
Parameters: | other – PySide.QtGui.QMatrix4x4 |
---|---|
Return type: | PySide.QtGui.QMatrix4x4 |
Subtracts the contents of other from this matrix.
Parameters: | divisor – PySide.QtCore.qreal |
---|---|
Return type: | PySide.QtGui.QMatrix4x4 |
Parameters: | divisor – PySide.QtCore.qreal |
---|---|
Return type: | PySide.QtGui.QMatrix4x4 |
This is an overloaded function.
Divides all elements of this matrix by divisor .
Parameters: | other – PySide.QtGui.QMatrix4x4 |
---|---|
Return type: | PySide.QtCore.bool |
Returns true if this matrix is identical to other ; false otherwise. This operator uses an exact floating-point comparison.
Optimize the usage of this matrix from its current elements.
Some operations such as PySide.QtGui.QMatrix4x4.translate() , PySide.QtGui.QMatrix4x4.scale() , and PySide.QtGui.QMatrix4x4.rotate() can be performed more efficiently if the matrix being modified is already known to be the identity, a previous PySide.QtGui.QMatrix4x4.translate() , a previous PySide.QtGui.QMatrix4x4.scale() , etc.
Normally the PySide.QtGui.QMatrix4x4 class keeps track of this special type internally as operations are performed. However, if the matrix is modified directly with operator()() or PySide.QtGui.QMatrix4x4.data() , then PySide.QtGui.QMatrix4x4 will lose track of the special type and will revert to the safest but least efficient operations thereafter.
By calling PySide.QtGui.QMatrix4x4.optimize() after directly modifying the matrix, the programmer can force PySide.QtGui.QMatrix4x4 to recover the special type if the elements appear to conform to one of the known optimized types.
See also
operator()() PySide.QtGui.QMatrix4x4.data() PySide.QtGui.QMatrix4x4.translate()
Parameters: | rect – PySide.QtCore.QRectF |
---|
This is an overloaded function.
Multiplies this matrix by another that applies an orthographic projection for a window with boundaries specified by rect . The near and far clipping planes will be -1 and 1 respectively.
Parameters: |
|
---|
Multiplies this matrix by another that applies an orthographic projection for a window with lower-left corner (left , bottom ), upper-right corner (right , top ), and the specified nearPlane and farPlane clipping planes.
Parameters: | rect – PySide.QtCore.QRect |
---|
This is an overloaded function.
Multiplies this matrix by another that applies an orthographic projection for a window with boundaries specified by rect . The near and far clipping planes will be -1 and 1 respectively.
Return type: | PySide.QtGui.QMatrix4x4 |
---|
Parameters: |
|
---|
Multiplies this matrix by another that applies a perspective projection. The field of view will be angle degrees within a window with a given aspect ratio. The projection will have the specified nearPlane and farPlane clipping planes.
Parameters: |
|
---|
Parameters: |
|
---|
This is an overloaded function.
Multiplies this matrix by another that rotates coordinates through angle degrees about the vector (x , y , z ).
Parameters: | quaternion – PySide.QtGui.QQuaternion |
---|
Multiples this matrix by another that rotates coordinates according to a specified quaternion . The quaternion is assumed to have been normalized.
Parameters: |
|
---|
Multiples this matrix by another that rotates coordinates through angle degrees about vector .
Parameters: | index – PySide.QtCore.int |
---|---|
Return type: | PySide.QtGui.QVector4D |
Returns the elements of row index as a 4D vector.
Parameters: |
|
---|
This is an overloaded function.
Multiplies this matrix by another that scales coordinates by the components x , y , and z .
Parameters: |
|
---|
This is an overloaded function.
Multiplies this matrix by another that scales coordinates by the components x , and y .
Parameters: | factor – PySide.QtCore.qreal |
---|
This is an overloaded function.
Multiplies this matrix by another that scales coordinates by the given factor .
Parameters: | vector – PySide.QtGui.QVector3D |
---|
Multiplies this matrix by another that scales coordinates by the components of vector .
Parameters: |
|
---|
Sets the elements of column index to the components of value .
Parameters: |
|
---|
Sets the elements of row index to the components of value .
Sets this matrix to the identity.
See also
Return type: | PySide.QtGui.QMatrix |
---|
Returns the conventional Qt 2D affine transformation matrix that corresponds to this matrix. It is assumed that this matrix only contains 2D affine transformation elements.
Parameters: | distanceToPlane – PySide.QtCore.qreal |
---|---|
Return type: | PySide.QtGui.QTransform |
Returns the conventional Qt 2D transformation matrix that corresponds to this matrix.
If distanceToPlane is non-zero, it indicates a projection factor to use to adjust for the z co-ordinate. The value of 1024 corresponds to the projection factor used by QTransform.rotate() for the x and y axes.
If distanceToPlane is zero, then the returned PySide.QtGui.QTransform is formed by simply dropping the third row and third column of the PySide.QtGui.QMatrix4x4 . This is suitable for implementing orthographic projections where the z co-ordinate should be dropped rather than projected.
See also
Return type: | PySide.QtGui.QTransform |
---|
Returns the conventional Qt 2D transformation matrix that corresponds to this matrix.
The returned PySide.QtGui.QTransform is formed by simply dropping the third row and third column of the PySide.QtGui.QMatrix4x4 . This is suitable for implementing orthographic projections where the z co-ordinate should be dropped rather than projected.
See also
Parameters: |
|
---|
This is an overloaded function.
Multiplies this matrix by another that translates coordinates by the components x , y , and z .
Parameters: | vector – PySide.QtGui.QVector3D |
---|
Multiplies this matrix by another that translates coordinates by the components of vector .
Parameters: |
|
---|
This is an overloaded function.
Multiplies this matrix by another that translates coordinates by the components x , and y .
Return type: | PySide.QtGui.QMatrix4x4 |
---|
Returns this matrix, transposed about its diagonal.