PDA

View Full Version : Make camera rotate 360 in either yaw pitch or roll forever


Queenss_RA
05-31-2013, 12:04 PM
Hi,

So I've been working on this for awhile and can't find a good solution. How can I make the camera spin 360 degrees in either yaw axis, pitch axis or roll axis non-stop and I can stop it and restart it by just pressing the space bar?

Jeff
06-10-2013, 04:06 PM
Here's an example:

import viz
import vizact

viz.go()

viz.add('piazza.osgb')

viewNode = viz.addGroup()
viewLink = viz.link(viewNode, viz.MainView)
viewNode.setPosition([0,2,0])
spinAction = vizact.spin(0,1,0,20,viz.FOREVER)

viewNode.addAction(spinAction)

def pauseAndRestart():
if viewNode.getAction():
viewNode.clearActions()
else:
viewNode.setEuler([0,0,0])
viewNode.addAction(spinAction)

vizact.onkeydown(' ', pauseAndRestart)