WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Rotating an object around a point (https://forum.worldviz.com/showthread.php?t=5486)

BWhiteDerby 08-25-2015 10:00 AM

Rotating an object around a point
 
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:

Code:

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)



All times are GMT -7. The time now is 04:57 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC