PDA

View Full Version : Rotating an object around a point


BWhiteDerby
08-25-2015, 10:00 AM
Hi all, I'm trying to add a series of animations to objects that cause it orbit another, similar to the vizact.spin() function. Is there an easy way to do this? If not could you please help me come up with the code to do so?
Many thanks.

Jeff
08-25-2015, 04:37 PM
You can create a parent/child hierarchy and then spin the parent:

import viz
import vizact
viz.go()

viz.addChild('dojo.osgb')

group = viz.addGroup(pos=[0,2,5])
ball = viz.addChild('beachball.osgb',pos=[2,0,0])
ball.setParent(group)

spin = vizact.spin(0,1,0,45)
group.runAction(spin)