|
#1
|
|||
|
|||
Reset Pitch?
Is there an easy way to reset the pitch to 0? I do not completely trust that my tracker is coplanar with my hmd lenses, and would like to be able to define what the user feels is "level".
I have tried using preEuler but I have to apply it a few times and it doesn't always seem right. The link.reset() doesn't have a flag to transform specific Euler values, does it? |
#2
|
|||
|
|||
You should be able to use a single preEuler operator to reset the pitch to zero. The following sample code demonstrates how to reset the pitch during runtime. It will take the current raw euler values from the tracker and apply the inverse pitch to a preEuler operator.
Code:
import viz import vizact viz.go() viz.add('maze.osgb') tracker = viz.add('testtrack_ori.dls') view_link = viz.link(tracker,viz.MainView) pitch_reset = view_link.preEuler([0,0,0],target=viz.LINK_ORI_OP) def ResetPitch(): yaw,pitch,roll = tracker.getEuler() pitch_reset.setEuler([0,-pitch,0]) vizact.onkeydown('r',ResetPitch) |
#3
|
|||
|
|||
Thanks for the help, that works well.
Now I am trying to do a reset of the pitch, yaw, AND roll with a custom value for the pitch and "zeroing" for the yaw and roll. I would like to have the yaw and roll reset first and then set the pitch. I really can't grasp the correct order for these transformations; this article is the best I could find: http://docs.worldviz.com/vizard/Link_operators.htm If I try to reset the yaw and roll first with a preEuler using the opposite values from the tracker, I get weird issues where I am moving or rotating the wrong directions. Any help on the best order/functions to implement this? I'm using the IS-900 for both position and euler. |
#4
|
|||
|
|||
It works if I use postEuler instead of preEuler and use separate operator objects for each rotation. I also needed to use the flag target=viz.LINK_FULL_OP for at least yaw, and set the priority numbers in ascending order for yaw, roll, pitch.
|
#5
|
|||
|
|||
Actually preEuler on the pitch, but postEuler for yaw and roll. Everything else the same.
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Coordinate system flips when pitch crosses 90deg? | bernie | Vizard | 6 | 04-15-2010 05:31 PM |
reset intersense not working | billjarrold | Vizard | 9 | 03-31-2010 09:53 PM |
The problem of tracker using via VRPN | _kj_ | Vizard | 2 | 08-13-2009 12:03 AM |
question about yaw, pitch, roll | TunTun | Vizard | 2 | 05-23-2007 12:46 PM |
Pitch Question | nickyee | Vizard | 1 | 07-14-2004 10:07 AM |