WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Make camera rotate 360 in either yaw pitch or roll forever (https://forum.worldviz.com/showthread.php?t=4614)

Queenss_RA 05-31-2013 12:04 PM

Make camera rotate 360 in either yaw pitch or roll forever
 
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:
Code:

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)



All times are GMT -7. The time now is 03:37 AM.

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