View Single Post
  #2  
Old 08-12-2004, 10:54 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi Max,

The order in which you call the center and rotate commands makes no difference in the final position of the object. In your case you will need to either perform the matrix operations manually using a vizmat transform or use a transform hierarchy. Here's some sample code on how to use a transform hierarchy:
Code:
#Create a group node that will be the parent for the box
objParent = viz.add(viz.GROUP)

#Add the box to the group node
obj1 = objParent.add('box.wrl')

#Set the center of the group node
objParent.center(-1,0,-1)

#This won't affect the position of the box,
#because the rotation is being applied beneath the group node
obj1.rotate(40,0,0)

#This will affect the position of the box,
#becuase the rotation is being applied above the box node
objParent.rotate(40,0,0)
Let me know if you need any more help.
Reply With Quote