• PySide 模块
  • PySide.QtGui
  • 内容表

    上一话题

    QVector2D

    下一话题

    QQuaternion

    QMatrix4x4

    注意

    该类在 Qt4.6 引入

    概要

    函数

    详细描述

    PySide.QtGui.QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.

    另请参阅

    PySide.QtGui.QVector3D QGenericMatrix

    class PySide.QtGui. QMatrix4x4
    class PySide.QtGui. QMatrix4x4 ( matrix )
    class PySide.QtGui. QMatrix4x4 ( QMatrix4x4 )
    class PySide.QtGui. QMatrix4x4 ( transform )
    class PySide.QtGui. QMatrix4x4 ( values )
    class PySide.QtGui. QMatrix4x4 ( m11 , m12 , m13 , m14 , m21 , m22 , m23 , m24 , m31 , m32 , m33 , m34 , m41 , m42 , m43 , m44 )
    参数:
    • m42 PySide.QtCore.qreal
    • values PySide.QtCore.qreal
    • m43 PySide.QtCore.qreal
    • m44 PySide.QtCore.qreal
    • m21 PySide.QtCore.qreal
    • m22 PySide.QtCore.qreal
    • m23 PySide.QtCore.qreal
    • m24 PySide.QtCore.qreal
    • QMatrix4x4 PySide.QtGui.QMatrix4x4
    • m31 PySide.QtCore.qreal
    • m32 PySide.QtCore.qreal
    • m33 PySide.QtCore.qreal
    • m34 PySide.QtCore.qreal
    • m11 PySide.QtCore.qreal
    • m12 PySide.QtCore.qreal
    • matrix PySide.QtGui.QMatrix
    • m13 PySide.QtCore.qreal
    • m14 PySide.QtCore.qreal
    • transform PySide.QtGui.QTransform
    • m41 PySide.QtCore.qreal

    构造恒等矩阵。

    Constructs a 4x4 matrix from a conventional Qt 2D affine transformation matrix .

    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() ,等。

    Constructs a 4x4 matrix from the conventional Qt 2D transformation matrix transform .

    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() ,等。

    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() ,等。

    Constructs a matrix from the 16 elements m11 , m12 , m13 , m14 , m21 , m22 , m23 , m24 , m31 , m32 , m33 , m34 , m41 , m42 , m43 ,和 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() ,等。

    PySide.QtGui.QMatrix4x4. __mgetitem__ ( )
    返回类型: PyObject
    PySide.QtGui.QMatrix4x4. __reduce__ ( )
    返回类型: PyObject
    PySide.QtGui.QMatrix4x4. __repr__ ( )
    返回类型: PyObject
    PySide.QtGui.QMatrix4x4. column ( index )
    参数: index PySide.QtCore.int
    返回类型: PySide.QtGui.QVector4D

    Returns the elements of column index as a 4D vector.

    PySide.QtGui.QMatrix4x4. copyDataTo ( )

    Retrieves the 16 items in this matrix and copies them to values in row-major order.

    PySide.QtGui.QMatrix4x4. determinant ( )
    返回类型: PySide.QtCore.qreal

    Returns the determinant of this matrix.

    PySide.QtGui.QMatrix4x4. fill ( value )
    参数: value PySide.QtCore.qreal

    Fills all elements of this matrx with value .

    PySide.QtGui.QMatrix4x4. flipCoordinates ( )

    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.

    PySide.QtGui.QMatrix4x4. frustum ( left , right , bottom , top , nearPlane , farPlane )
    参数:
    • left PySide.QtCore.qreal
    • right PySide.QtCore.qreal
    • bottom PySide.QtCore.qreal
    • top PySide.QtCore.qreal
    • nearPlane PySide.QtCore.qreal
    • farPlane PySide.QtCore.qreal

    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.

    PySide.QtGui.QMatrix4x4. inverted ( )
    返回类型: PyTuple

    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.

    PySide.QtGui.QMatrix4x4. isIdentity ( )
    返回类型: PySide.QtCore.bool

    Returns true if this matrix is the identity; false otherwise.

    PySide.QtGui.QMatrix4x4. lookAt ( eye , center , up )
    参数:

    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 .

    PySide.QtGui.QMatrix4x4. map ( point )
    参数: point PySide.QtGui.QVector4D
    返回类型: PySide.QtGui.QVector4D

    Maps point by multiplying this matrix by point .

    PySide.QtGui.QMatrix4x4. map ( point )
    参数: point PySide.QtGui.QVector3D
    返回类型: PySide.QtGui.QVector3D

    Maps point by multiplying this matrix by point .

    PySide.QtGui.QMatrix4x4. map ( point )
    参数: point PySide.QtCore.QPoint
    返回类型: PySide.QtCore.QPoint

    Maps point by multiplying this matrix by point .

    PySide.QtGui.QMatrix4x4. map ( point )
    参数: point PySide.QtCore.QPointF
    返回类型: PySide.QtCore.QPointF

    Maps point by multiplying this matrix by point .

    PySide.QtGui.QMatrix4x4. mapRect ( rect )
    参数: rect PySide.QtCore.QRectF
    返回类型: 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.

    PySide.QtGui.QMatrix4x4. mapRect ( rect )
    参数: rect PySide.QtCore.QRect
    返回类型: 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.

    PySide.QtGui.QMatrix4x4. mapVector ( vector )
    参数: vector PySide.QtGui.QVector3D
    返回类型: 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.

    PySide.QtGui.QMatrix4x4. normalMatrix ( )
    返回类型: 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.

    PySide.QtGui.QMatrix4x4. __ne__ ( other )
    参数: other PySide.QtGui.QMatrix4x4
    返回类型: PySide.QtCore.bool

    Returns true if this matrix is not identical to other ; false otherwise. This operator uses an exact floating-point comparison.

    PySide.QtGui.QMatrix4x4. __mul__ ( factor )
    参数: factor PySide.QtCore.qreal
    返回类型: PySide.QtGui.QMatrix4x4
    PySide.QtGui.QMatrix4x4. __mul__ ( factor )
    参数: factor PySide.QtCore.qreal
    返回类型: PySide.QtGui.QMatrix4x4
    PySide.QtGui.QMatrix4x4. __mul__ ( m2 )
    参数: m2 PySide.QtGui.QMatrix4x4
    返回类型: PySide.QtGui.QMatrix4x4
    PySide.QtGui.QMatrix4x4. __imul__ ( factor )
    参数: factor PySide.QtCore.qreal
    返回类型: PySide.QtGui.QMatrix4x4

    这是重载函数。

    Multiplies all elements of this matrix by factor .

    PySide.QtGui.QMatrix4x4. __imul__ ( other )
    参数: other PySide.QtGui.QMatrix4x4
    返回类型: PySide.QtGui.QMatrix4x4

    Multiplies the contents of other by this matrix.

    PySide.QtGui.QMatrix4x4. __add__ ( m2 )
    参数: m2 PySide.QtGui.QMatrix4x4
    返回类型: PySide.QtGui.QMatrix4x4
    PySide.QtGui.QMatrix4x4. __iadd__ ( other )
    参数: other PySide.QtGui.QMatrix4x4
    返回类型: PySide.QtGui.QMatrix4x4

    Adds the contents of other to this matrix.

    PySide.QtGui.QMatrix4x4. __sub__ ( )
    返回类型: PySide.QtGui.QMatrix4x4
    PySide.QtGui.QMatrix4x4. __sub__ ( m2 )
    参数: m2 PySide.QtGui.QMatrix4x4
    返回类型: PySide.QtGui.QMatrix4x4
    PySide.QtGui.QMatrix4x4. __isub__ ( other )
    参数: other PySide.QtGui.QMatrix4x4
    返回类型: PySide.QtGui.QMatrix4x4

    Subtracts the contents of other from this matrix.

    PySide.QtGui.QMatrix4x4. __div__ ( divisor )
    参数: divisor PySide.QtCore.qreal
    返回类型: PySide.QtGui.QMatrix4x4
    PySide.QtGui.QMatrix4x4. __idiv__ ( divisor )
    参数: divisor PySide.QtCore.qreal
    返回类型: PySide.QtGui.QMatrix4x4

    这是重载函数。

    Divides all elements of this matrix by divisor .

    PySide.QtGui.QMatrix4x4. __eq__ ( other )
    参数: other PySide.QtGui.QMatrix4x4
    返回类型: PySide.QtCore.bool

    Returns true if this matrix is identical to other ; false otherwise. This operator uses an exact floating-point comparison.

    PySide.QtGui.QMatrix4x4. optimize ( )

    Optimize the usage of this matrix from its current elements.

    Some operations such as PySide.QtGui.QMatrix4x4.translate() , PySide.QtGui.QMatrix4x4.scale() ,和 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() ,等。

    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() ,那么 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.

    另请参阅

    operator()() PySide.QtGui.QMatrix4x4.data() PySide.QtGui.QMatrix4x4.translate()

    PySide.QtGui.QMatrix4x4. ortho ( rect )
    参数: rect PySide.QtCore.QRectF

    这是重载函数。

    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.

    PySide.QtGui.QMatrix4x4. ortho ( left , right , bottom , top , nearPlane , farPlane )
    参数:
    • left PySide.QtCore.qreal
    • right PySide.QtCore.qreal
    • bottom PySide.QtCore.qreal
    • top PySide.QtCore.qreal
    • nearPlane PySide.QtCore.qreal
    • farPlane PySide.QtCore.qreal

    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.

    PySide.QtGui.QMatrix4x4. ortho ( rect )
    参数: rect PySide.QtCore.QRect

    这是重载函数。

    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.

    PySide.QtGui.QMatrix4x4. orthonormalInverse ( )
    返回类型: PySide.QtGui.QMatrix4x4
    PySide.QtGui.QMatrix4x4. perspective ( angle , aspect , nearPlane , farPlane )
    参数:
    • angle PySide.QtCore.qreal
    • aspect PySide.QtCore.qreal
    • nearPlane PySide.QtCore.qreal
    • farPlane PySide.QtCore.qreal

    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.

    PySide.QtGui.QMatrix4x4. projectedRotate ( angle , x , y , z )
    参数:
    • angle PySide.QtCore.qreal
    • x PySide.QtCore.qreal
    • y PySide.QtCore.qreal
    • z PySide.QtCore.qreal
    PySide.QtGui.QMatrix4x4. rotate ( angle , x , y [ , z=0.0f ] )
    参数:
    • angle PySide.QtCore.qreal
    • x PySide.QtCore.qreal
    • y PySide.QtCore.qreal
    • z PySide.QtCore.qreal

    这是重载函数。

    Multiplies this matrix by another that rotates coordinates through angle degrees about the vector ( x , y , z ).

    PySide.QtGui.QMatrix4x4. rotate ( quaternion )
    参数: quaternion PySide.QtGui.QQuaternion

    Multiples this matrix by another that rotates coordinates according to a specified quaternion quaternion is assumed to have been normalized.

    PySide.QtGui.QMatrix4x4. rotate ( angle , vector )
    参数:

    Multiples this matrix by another that rotates coordinates through angle degrees about vector .

    PySide.QtGui.QMatrix4x4. row ( index )
    参数: index PySide.QtCore.int
    返回类型: PySide.QtGui.QVector4D

    Returns the elements of row index as a 4D vector.

    PySide.QtGui.QMatrix4x4. scale ( x , y , z )
    参数:
    • x PySide.QtCore.qreal
    • y PySide.QtCore.qreal
    • z PySide.QtCore.qreal

    这是重载函数。

    Multiplies this matrix by another that scales coordinates by the components x , y ,和 z .

    PySide.QtGui.QMatrix4x4. scale ( x , y )
    参数:
    • x PySide.QtCore.qreal
    • y PySide.QtCore.qreal

    这是重载函数。

    Multiplies this matrix by another that scales coordinates by the components x ,和 y .

    PySide.QtGui.QMatrix4x4. scale ( factor )
    参数: factor PySide.QtCore.qreal

    这是重载函数。

    Multiplies this matrix by another that scales coordinates by the given factor .

    PySide.QtGui.QMatrix4x4. scale ( vector )
    参数: vector PySide.QtGui.QVector3D

    Multiplies this matrix by another that scales coordinates by the components of vector .

    PySide.QtGui.QMatrix4x4. setColumn ( index , value )
    参数:

    Sets the elements of column index to the components of value .

    PySide.QtGui.QMatrix4x4. setRow ( index , value )
    参数:

    Sets the elements of row index to the components of value .

    PySide.QtGui.QMatrix4x4. setToIdentity ( )

    将此矩阵设为恒等。

    PySide.QtGui.QMatrix4x4. toAffine ( )
    返回类型: 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.

    PySide.QtGui.QMatrix4x4. toTransform ( distanceToPlane )
    参数: distanceToPlane PySide.QtCore.qreal
    返回类型: PySide.QtGui.QTransform

    Returns the conventional Qt 2D transformation matrix that corresponds to this matrix.

    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.

    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.

    PySide.QtGui.QMatrix4x4. toTransform ( )
    返回类型: PySide.QtGui.QTransform

    Returns the conventional Qt 2D transformation matrix that corresponds to this matrix.

    返回的 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.

    PySide.QtGui.QMatrix4x4. translate ( x , y , z )
    参数:
    • x PySide.QtCore.qreal
    • y PySide.QtCore.qreal
    • z PySide.QtCore.qreal

    这是重载函数。

    Multiplies this matrix by another that translates coordinates by the components x , y ,和 z .

    PySide.QtGui.QMatrix4x4. translate ( vector )
    参数: vector PySide.QtGui.QVector3D

    Multiplies this matrix by another that translates coordinates by the components of vector .

    PySide.QtGui.QMatrix4x4. translate ( x , y )
    参数:
    • x PySide.QtCore.qreal
    • y PySide.QtCore.qreal

    这是重载函数。

    Multiplies this matrix by another that translates coordinates by the components x ,和 y .

    PySide.QtGui.QMatrix4x4. transposed ( )
    返回类型: PySide.QtGui.QMatrix4x4

    Returns this matrix, transposed about its diagonal.