WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-13-2004, 06:33 PM
nickyee nickyee is offline
Member
 
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.

Nick
Reply With Quote
  #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
Reply

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 04:03 AM.


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