vrml.vrml97.nodepath
Node-paths for VRML97 incl. transform-matrix calculation
Classes
class _MatrixHolder(
object
):
Path within a VRML97 scenegraph from root to particular node
Adds transformation-matrix calculation functions
based on the nodetypes.Transforming node's
attributes.
transformMatrix(
self
,
translate
= True
,
scale
= True
,
rotate
= True
,
matrixHolder
= False
,
inverse
= False
)
Calculate (and cache) a transform matrix for this path
Calculates our transformMatrix from our parent's transform
and the set of nodes between our parent and ourself. Normally
that should be a *single* node or *none* in most cases.
- translate
- if true, include translations in the matrix
- scale
- if true, include scales in the matrix
- rotate
- if true, include rotations in the matrix
Note: to apply these matrices to a particular coordinate,
you would do the following:
p = ones( 4 )
p[:3] = coordinate
return dot( p, matrix)
That is, you use the homogenous coordinate, and
make it the first item in the dot'ing.
Weak-reference version of VRML97 NodePath