Thread: Pitch Question
View Single Post
  #2  
Old 07-14-2004, 10:07 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi Nick,

Once the pitch goes past 90, the yaw and roll are flipped 180 degrees and the pitch starts decreasing. If you would prefer the pitch to keep increasing past 90 then you could manually calculate it. Here's some sample code:
Code:
import math

look = viz.get(viz.VIEW_LOOK)
x = viz.Vector(look[0],0,look[2]).length()
if look[4] < 0:
    x *= -1
y = -look[1]
pitch = viz.degrees(math.atan2(y,x))
Hope this helps
Reply With Quote