PDA

View Full Version : smooth accelerations and decelerations for translations and rotations?


bernie
08-07-2009, 08:40 PM
I'd like to move the viewpoint on a simple path (e.g., translation, curve, translation), and the vizact commands do that quite elegantly - the only problem is that I did not find any way to have smooth changes in velocity (similar to smooth accelerations and decelerations (braking)). It look a bit jerky, and observers are more likely to get sick this way :(

Any ideas/suggestions?
Thanks!

here's some code that produces the jerky motion onset/offset for translations and rotations

import viz

viz.go()

#Add the ground plane
viz.add('tut_ground.wrl')

#Move whatever forward at 2 m/sec for 5 seconds
firstTranslation = vizact.move(0,0,3,3)

# make a curve out of a combined rotation and translation
secondTranslation = vizact.move(0,0,2, 3)
# rotate 120 deg in 3 seconds
secondRotation = vizact.spinto(0,1,0, 120, 3, viz.TIME)
secondMotion = vizact.parallel(secondTranslation, secondRotation)

# make another straight path segment
thirdTranslation = vizact.move(0,0,3,2)

# assemble the sequence of individual path segments into one
moveAlongPath = vizact.sequence(firstTranslation, secondMotion, thirdTranslation)

#move observer along path when spacebar is pressed
vizact.onkeydown(' ', viz.MainView.add, moveAlongPath)