WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Rotate viewpoint while moving (https://forum.worldviz.com/showthread.php?t=4525)

AndyGuatemala 03-19-2013 01:28 PM

Rotate viewpoint while moving
 
So I'm trying to make a train simulation in which the viewpoint moves forward and rotates by itself once it is close to an object.
I am able to make it turn while moving forward when I'm pressing down a key however, I can not figure out how to make it rotate smoothly without using a key. When I try using the setEuler without pressing a key, it turns however, it is not smooth at all. Any ideas on how to make it turn smoothly on its own?

Jeff 03-20-2013 01:41 AM

Create a spin action with the vizact.spinTo command and apply that to the viewpoint:
Code:

spinAction = vizact.spinTo(euler=[180,0,0], speed=30)
vizact.onkeydown(' ', viz.MainView.runAction, spinAction )



All times are GMT -7. The time now is 12:48 AM.

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