Note
This class was introduced in Qt 4.6
The PySide.QtGui.QVector3D class represents a vector or vertex in 3D space.
Vectors are one of the main building blocks of 3D representation and drawing. They consist of three coordinates, traditionally called x, y, and z.
The PySide.QtGui.QVector3D class can also be used to represent vertices in 3D space. We therefore do not need to provide a separate vertex class.
Parameters: |
|
---|
Constructs a null vector, i.e. with coordinates (0, 0, 0).
Constructs a vector with x and y coordinates from a 2D point , and a z coordinate of 0.
Constructs a vector with x and y coordinates from a 2D point , and a z coordinate of 0.
Constructs a 3D vector from the specified 2D vector . The z coordinate is set to zero.
See also
Constructs a 3D vector from the specified 2D vector . The z coordinate is set to zpos .
See also
Constructs a 3D vector from the specified 4D vector . The w coordinate is dropped.
See also
Constructs a vector with coordinates (xpos , ypos , zpos ).
Return type: | PyObject |
---|
Return type: | PyObject |
---|
Parameters: |
|
---|---|
Return type: |
Returns the cross-product of vectors v1 and v2 , which corresponds to the normal vector of a plane defined by v1 and v2 .
See also
Parameters: |
|
---|---|
Return type: | PySide.QtCore.qreal |
Returns the distance that this vertex is from a line defined by point and the unit vector direction .
If direction is a null vector, then it does not define a line. In that case, the distance from point to this vertex is returned.
Parameters: |
|
---|---|
Return type: | PySide.QtCore.qreal |
This is an overloaded function.
Returns the distance from this vertex a plane defined by the vertices plane1 , plane2 and plane3 .
The return value will be negative if the vertex is below the plane, or zero if it is on the plane.
The two vectors that define the plane are plane2 - plane1 and plane3 - plane1 .
Parameters: |
|
---|---|
Return type: | PySide.QtCore.qreal |
Returns the distance from this vertex to a plane defined by the vertex plane and a normal unit vector. The normal parameter is assumed to have been normalized to a unit vector.
The return value will be negative if the vertex is below the plane, or zero if it is on the plane.
Parameters: |
|
---|---|
Return type: | PySide.QtCore.qreal |
Returns the dot product of v1 and v2 .
Return type: | PySide.QtCore.bool |
---|
Returns true if the x, y, and z coordinates are set to 0.0, otherwise returns false.
Return type: | PySide.QtCore.qreal |
---|
Returns the length of the vector from the origin.
Return type: | PySide.QtCore.qreal |
---|
Returns the squared length of the vector from the origin. This is equivalent to the dot product of the vector with itself.
Parameters: |
|
---|---|
Return type: |
This is an overloaded function.
Returns the normal vector of a plane defined by vectors v2 - v1 and v3 - v1 , normalized to be a unit vector.
Use PySide.QtGui.QVector3D.crossProduct() to compute the cross-product of v2 - v1 and v3 - v1 if you do not need the result to be normalized to a unit vector.
Parameters: |
|
---|---|
Return type: |
Returns the normal vector of a plane defined by vectors v1 and v2 , normalized to be a unit vector.
Use PySide.QtGui.QVector3D.crossProduct() to compute the cross-product of v1 and v2 if you do not need the result to be normalized to a unit vector.
Normalizes the currect vector in place. Nothing happens if this vector is a null vector or the length of the vector is very close to 1.
Return type: | PySide.QtGui.QVector3D |
---|
Returns the normalized unit vector form of this vector.
If this vector is null, then a null vector is returned. If the length of the vector is very close to 1, then the vector will be returned as-is. Otherwise the normalized form of the vector of length 1 will be returned.
Parameters: | v2 – PySide.QtGui.QVector3D |
---|---|
Return type: | PySide.QtCore.bool |
Parameters: | factor – PySide.QtCore.qreal |
---|---|
Return type: | PySide.QtGui.QVector3D |
Parameters: | factor – PySide.QtCore.qreal |
---|---|
Return type: | PySide.QtGui.QVector3D |
Parameters: | matrix – PySide.QtGui.QMatrix4x4 |
---|---|
Return type: | PySide.QtGui.QVector3D |
Parameters: | v2 – PySide.QtGui.QVector3D |
---|---|
Return type: | PySide.QtGui.QVector3D |
Parameters: | matrix – PySide.QtGui.QMatrix4x4 |
---|---|
Return type: | PySide.QtGui.QVector3D |
Parameters: | factor – PySide.QtCore.qreal |
---|---|
Return type: | PySide.QtGui.QVector3D |
Multiplies this vector’s coordinates by the given factor , and returns a reference to this vector.
See also
PySide.QtGui.QVector3D.operator/=()
Parameters: | vector – PySide.QtGui.QVector3D |
---|---|
Return type: | PySide.QtGui.QVector3D |
This is an overloaded function.
Multiplies the components of this vector by the corresponding components in vector .
Note: this is not the same as the PySide.QtGui.QVector3D.crossProduct() of this vector and vector .
Parameters: | v2 – PySide.QtGui.QVector3D |
---|---|
Return type: | PySide.QtGui.QVector3D |
Parameters: | vector – PySide.QtGui.QVector3D |
---|---|
Return type: | PySide.QtGui.QVector3D |
Adds the given vector to this vector and returns a reference to this vector.
See also
PySide.QtGui.QVector3D.operator-=()
Return type: | PySide.QtGui.QVector3D |
---|
Parameters: | v2 – PySide.QtGui.QVector3D |
---|---|
Return type: | PySide.QtGui.QVector3D |
Parameters: | vector – PySide.QtGui.QVector3D |
---|---|
Return type: | PySide.QtGui.QVector3D |
Subtracts the given vector from this vector and returns a reference to this vector.
See also
PySide.QtGui.QVector3D.operator+=()
Parameters: | divisor – PySide.QtCore.qreal |
---|---|
Return type: | PySide.QtGui.QVector3D |
Parameters: | divisor – PySide.QtCore.qreal |
---|---|
Return type: | PySide.QtGui.QVector3D |
Divides this vector’s coordinates by the given divisor , and returns a reference to this vector.
See also
PySide.QtGui.QVector3D.operator*=()
Parameters: | v2 – PySide.QtGui.QVector3D |
---|---|
Return type: | PySide.QtCore.bool |
Parameters: | x – PySide.QtCore.qreal |
---|
Sets the x coordinate of this point to the given x coordinate.
Parameters: | y – PySide.QtCore.qreal |
---|
Sets the y coordinate of this point to the given y coordinate.
Parameters: | z – PySide.QtCore.qreal |
---|
Sets the z coordinate of this point to the given z coordinate.
Return type: | PySide.QtCore.QPoint |
---|
Returns the PySide.QtCore.QPoint form of this 3D vector. The z coordinate is dropped.
Return type: | PySide.QtCore.QPointF |
---|
Returns the PySide.QtCore.QPointF form of this 3D vector. The z coordinate is dropped.
Return type: | PyObject |
---|
Return type: | PySide.QtGui.QVector2D |
---|
Returns the 2D vector form of this 3D vector, dropping the z coordinate.
Return type: | PySide.QtGui.QVector4D |
---|
Returns the 4D form of this 3D vector, with the w coordinate set to zero.
Return type: | PySide.QtCore.qreal |
---|
Returns the x coordinate of this point.
Return type: | PySide.QtCore.qreal |
---|
Returns the y coordinate of this point.
Return type: | PySide.QtCore.qreal |
---|
Returns the z coordinate of this point.