View Single Post
  #4  
Old 08-13-2004, 11:05 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi Max,

Try using the following code to set the center of an object without affecting its translation:
Code:
oldpos = obj1.get(viz.POSITION,viz.ABSOLUTE_WORLD)
obj1.center(-1,0,-1)
newpos = obj1.get(viz.POSITION,viz.ABSOLUTE_WORLD)
obj1.translate(oldpos[0]-newpos[0],oldpos[1]-newpos[1],oldpos[2]-newpos[2],viz.RELATIVE_WORLD)
Reply With Quote