View Single Post
  #3  
Old 06-26-2009, 07:28 PM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
Just though of another way to stop sideways motion. Check every frame if the view has moved in any direction other than forward or back.
Code:
#sudo code

#every frame
displacementVector = currentViewPosVector - lastViewPosVector
headingDisplacementVector  = vizmat.LookToQuat(displacementVector))
viewDisplacementHeadingDiff = vizmat.QuatDiff(headingDisplacementVector, viz.MainView.getQuat())
if viewDisplacementHeadingDiff != 0 or viewDisplacementHeadingDiff != 180:
    viz.MainView.setPosition(lastViewPos) #stop
__________________
Paul Elliott
WorldViz LLC
Reply With Quote