View Single Post
  #3  
Old 08-27-2003, 09:00 AM
tobin tobin is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 251
other Euler combinations

While Vizard uses the yaw, pitch, roll convention for its Euler angles, it's relatively easy to construct your own rotations based on any Euler order. To do so, one can use the "vizmat" matrices library that provides lots of matrix-based operations at the Python programming level.

Here's an example showing how to rotate an object in XYZ Euler order instead of YXZ (yaw, pitch, roll). This example rotates the object 10 deg along each axis:

import vizmat

b = viz.add('myobject.wrl')

X = vizmat.Transform()
X.makeIdent()
X.postRot(X, 1,0,0, 10.0/180*math.pi)
X.postRot(X, 0,1,0, 10.0/180*math.pi)
X.postRot(X, 0,0,1, 10.0/180*math.pi)

b.update(X)
Reply With Quote