WorldViz User Forum Pitch Question
 Register FAQ Search Today's Posts Mark Forums Read

#1
07-13-2004, 07:33 PM
 nickyee 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
#2
07-14-2004, 11:07 AM
 farshizzo 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

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements Vizard Precision Position Tracker (PPT) Plug-in development

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