mababio / liquid-galaxy

Automatically exported from code.google.com/p/liquid-galaxy
Apache License 2.0
0 stars 0 forks source link

RollOffset seems to being applied twice? #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
G'day - I think ViewSync/rollOffset is being interpreted incorrectly.

Example Setup - I want the View Master to appear like a GPS tracker and always 
views "down" (think Google Maps rather than Earth).

So, the View Master points at the ground (ie. towards centre of earth). And the 
set of View Slaves rollOffset by X degrees (say 30degrees each) and then pitch 
up 90degrees relative to the master to show a horizon line.

On the Slave when ViewSync/rollOffset is 0.0 and pitchOffset=90 this looks 
fine. Master points at ground, Slave shows horizon line (with same compass 
bearing as Master).

However on the next Slave, say rollOffset=30.0, the rollOffset seems to be 
applying twice. The slave is moved around the compass (good), but then the view 
is also rolled on itself (bad)!

The simplest way to show this... setup master pointing at ground and North 
being "up" the screen.

Setup Slave with "yawOffset=0.0 rollOffset=90.0 pitchOffset=90.0"

When the views are synced, the compass on the Slave will point towards East 
(this is correct), but the view is then rolled 90 degress off horizontal.
See attached image for an example of what happens.

Cheers, Andrew.

Original issue reported on code.google.com by alfski on 6 Oct 2010 at 11:07

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the bug report!  I think Earth may be applying the yaw/pitch/roll 
offsets in a different order than you're expecting, and I think you can get 
what you want with a little matrix math.  Let me bug Dan for some docs on that, 
and don't let us neglect to get it documented right.

Original comment by jh...@google.com on 7 Oct 2010 at 6:10

GoogleCodeExporter commented 9 years ago
The order of application of the rotations is yaw-->pitch-->roll. This is the 
typical idiomatic order of application for 3D graphics programs. Indeed, your 
view is rolled 90 degrees, with respect to a typical "unrolled" view. You 
probably want yawOffset.

-Dan

Original comment by mu...@google.com on 7 Oct 2010 at 6:10

GoogleCodeExporter commented 9 years ago
Working as intended.

Original comment by mu...@google.com on 7 Oct 2010 at 6:11