A 3-component floating point vector. Supports pickling.
The fourth component w is included because the underlying library uses 4-component vectors. Don’t use it unless otherwise mentioned in the documetation.
Creates a new zero vector.
Creates a new vector from given components.
Creates a new vector from another object.
3D Vector methods
Returns the radian angle between self and v.
Returns the cross product between self and v.
Returns the normalized direction from self to v.
Returns the distance between self and v.
Returns the minimum distance between self and a line of infinite length.
Returns the dot product between self and v.
Returns the length of self.
| Parameters: |
|
|---|
Performs a linear interpolation between self and v and returns the result.
Returns a normalized version of self.
| Parameters: |
|
|---|
Projects self from object space (3D) into screen space (2D).
Returns the reflected incident angle vector.
Projects self from screen space (2D) into object space (3D). See project().
3D Vector static methods
Performs a Catmull-Rom spline interpolation.
Performs a hermite spline interpolation.
| Parameters: |
|
|---|
Calculates the intersection between a ray and a triangle. Returns None if there is no intersection.
Calculates a normal for a triangle.
Attributes
Most operations have in-place (v *= 2 etc.) versions.
Float multiply.
Float divide.
Vector addition.
Vector subtraction.
Negation v2 = -v.
Vector supports certain sequence operations for tuple-like behaviour.
Returns the indexed value.
v = Vector(...)
assert (v.x == v