WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 07-13-2004, 07:33 PM
nickyee nickyee is offline
Join Date: Jun 2004
Location: Stanford, CA
Posts: 19
Pitch Question

I'm noticing that Pitch goes from 0 to 88..89..90 but then 89..88..87, so it's never more than abs(90). So there are two +80's and two -80's. How does it figure out what Pitch=80 is if there are two 80's?

We're trying to set head movement limits on a mimic script, and noticed this.

Reply With Quote
Old 07-14-2004, 11: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:
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

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -7. The time now is 01:14 PM.

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