PDA

View Full Version : Rotate viewpoint while moving


AndyGuatemala
03-19-2013, 01:28 PM
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:
spinAction = vizact.spinTo(euler=[180,0,0], speed=30)
vizact.onkeydown(' ', viz.MainView.runAction, spinAction )