WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Pitch Question (https://forum.worldviz.com/showthread.php?t=168)

nickyee 07-13-2004 06:33 PM

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

farshizzo 07-14-2004 10:07 AM

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


All times are GMT -7. The time now is 08:42 PM.

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