Home | Trees | Index | Help |
|
---|
Module Mathutils
|
|
This module provides access to matrices, eulers, quaternions and vectors.
Example:import Blender from Blender import Mathutils from Blender.Mathutils import * vec = Vector([1,2,3]) mat = RotationMatrix(90, 4, 'x') matT = TranslationMatrix(vec) matTotal = mat * matT matTotal.invert() mat3 = matTotal.rotationPart quat1 = mat.toQuat() quat2 = mat3.toQuat() angle = DifferenceQuats(quat1, quat2) print angle
Classes | |
---|---|
Euler |
This object gives access to Eulers in Blender. |
Matrix |
This object gives access to Matrices in Blender. |
Quaternion |
This object gives access to Quaternions in Blender. |
Vector |
This object gives access to Vectors in Blender. |
Function Summary | |
---|---|
float |
Return the angle between two vectors. |
Euler object |
Create a new euler object. |
Matrix object. |
Create a copy of the Matrix object. |
Quaternion object. |
Create a copy of the Quaternion object. |
Vector object. |
Create a copy of the Vector object. |
Quaternion object. |
Return the cross product of two quaternions. |
Vector object. |
Return the cross product of two vectors. |
Quaternion object |
Returns a quaternion represting the rotational difference. |
float |
Return the dot product of two quaternions. |
float |
Return the dot product of two vectors. |
Vector object |
Return the intersection between a ray and a triangle, if possible, return None otherwise. |
(Vector object, Vector object) |
Return a tuple with the points on each line respectively closest to the other (when both lines intersect, both vector hold the same value). |
Vector object |
Multiply a matrix and a vector (post-multiply) Vector size and matrix row size must equal. |
Vector object |
Return a vector to the midpoint between two vectors. |
Matrix object. |
Create a matrix to represent an orthographic projection |
Vector object |
Return the projection of vec1 onto vec2. |
float |
Return the normal of the 3D quad defined. |
Return a random number within a range. | |
Roatate a euler by an amount in degrees around an axis. | |
Matrix object. |
Create a matrix representing a rotation. |
Matrix object. |
Create a matrix representing a scaling. |
Matrix object. |
Create a matrix to represent an orthographic projection |
Quaternion object |
Returns the interpolation of two quaternions. |
Matrix object. |
Create a matrix representing a translation |
float |
Return the area size of the 2D or 3D triangle defined. |
float |
Return the normal of the 3D triangle defined. |
Vector object |
Multiply a vector and matrix (pre-multiply) Vector size and matrix column size must equal. |
Function Details |
---|
AngleBetweenVecs(vec1, vec2)Return the angle between two vectors. Zero length vectors raise an error.
|
CopyEuler(euler)Create a new euler object.
|
CopyMat(matrix)Create a copy of the Matrix object.
|
CopyQuat(quaternion)Create a copy of the Quaternion object.
|
CopyVec(vector)Create a copy of the Vector object.
|
CrossQuats(quat1, quat2)Return the cross product of two quaternions.
|
CrossVecs(vec1, vec2)Return the cross product of two vectors.
|
DifferenceQuats(quat1, quat2)Returns a quaternion represting the rotational difference.
|
DotQuats(quat1, quat2)Return the dot product of two quaternions.
|
DotVecs(vec1, vec2)Return the dot product of two vectors.
|
Intersect(vec1, vec2, vec3, ray, orig, clip=1)Return the intersection between a ray and a triangle, if possible, return None otherwise.
|
LineIntersect(vec1, vec2, vec3, vec4)Return a tuple with the points on each line respectively closest to the other (when both lines intersect, both vector hold the same value). The lines are evaluated as infinite lines in space, the values returned may not be between the 2 points given for each line.
|
MatMultVec(mat, vec)Multiply a matrix and a vector (post-multiply) Vector size and matrix row size must equal.
|
MidpointVecs(vec1, vec2)Return a vector to the midpoint between two vectors.
|
OrthoProjectionMatrix(plane, matSize, axis)Create a matrix to represent an orthographic projection
|
ProjectVecs(vec1, vec2)Return the projection of vec1 onto vec2.
|
QuadNormal(vec1, vec2, vec3, vec4)Return the normal of the 3D quad defined.
|
Rand(high=1, low=0)Return a random number within a range. High and low represent the range from which the random number must return its result.
|
RotateEuler(euler, angle, axis)Roatate a euler by an amount in degrees around an axis.
|
RotationMatrix(angle, matSize, axisFlag, axis)Create a matrix representing a rotation.
|
ScaleMatrix(factor, matSize, axis)Create a matrix representing a scaling.
|
ShearMatrix(plane, factor, matSize)Create a matrix to represent an orthographic projection
|
Slerp(quat1, quat2, factor)Returns the interpolation of two quaternions.
|
TranslationMatrix(vector)Create a matrix representing a translation
|
TriangleArea(vec1, vec2, vec3)Return the area size of the 2D or 3D triangle defined.
|
TriangleNormal(vec1, vec2, vec3)Return the normal of the 3D triangle defined.
|
VecMultMat(vec, mat)Multiply a vector and matrix (pre-multiply) Vector size and matrix column size must equal.
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Thu May 10 20:31:59 2007 | http://epydoc.sf.net |