View Single Post
  #2  
Old 05-05-2009, 12:47 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You can use the matrix.preEuler methods to rotate objects relative to arbitrary coordinate frames. Here is how you would roll object1 relative to object2's coordinate frame:
Code:
m = object2.getMatrix()
m.preEuler(0,0,1)
object1.setQuat(m.getQuat())
You would use similar code to perform the rotation relative to the viewpoint by retrieving the matrix from the viz.MainView object.

Let me know if I misunderstood your question or you need more specific examples.
Reply With Quote