I wrote:

>> I'm gradually figuring out a little bit of what the viewer 
>> code is doing.
>>
>> In particular:  As for the basic "cockpit lookfrom" view,
>> the viewer.cxx "reference frame" for attitudes is as follows:
>>
>>   Suppose you are over the Gulf of Guinea, at (lat,lon) = (0,0).
>>   Then the reference frame orientation can be achieved via:
>>     -- The aircraft X-axis (nose) headed south.
>>     -- The aircraft Y-axis (starboard wingtip) pointing up.
>>     -- The aircraft Z-axis (belly) pointing west.
>>
>>   Equivalently, but with less stress on the passengers, suppose 
>>   you are over the Indian Ocean, at (lat,lon) = (0,90).  
>>   Then the reference frame for attitudes can be achieved via:
>>     -- Heading = south.
>>     -- Pitch = level flight.
>>     -- Bank = level flight.
>>

On 11/06/2009 02:48 PM, Tim Moore wrote:

> You need to show your work :) 

The behavior reported above was observed using the feature
I implemented whereby the orientation quats are exposed in 
the property tree.  Erik committed the code, so anyone can 
easily replicate the observations.

Also the observed behavior is entirely consistent with the
apparent intent of the viewmgr.cxx code, as I read it.

  Note:  Since there was some criticism of one of the
  property names I used, and more importantly some quite 
  useful criticism of the underlying concepts and 
  interpretation, I have  submitted a follow-on patch 
  that should fully deal with these issues.
     http://www.av8n.com/fly/fgfs/viewframe.patch

> This doesn't agree with my understanding of
> viewer.cxx, but I didn't write it. This is what I thought was going on:
> 
> The basic reference frame for all geometry is your Earth Centered - Earth 
> Fixed
> frame.

Right.  ECEF is the first item on my list of reference frames
documented at
  http://www.av8n.com/physics/coords.htm

I reckon the real issue here is not ECEF itself, but rather
the fact that as mentioned at
  http://www.av8n.com/physics/coords.htm#sec-orientation
to describe the orientation of a body in space, you need
*two* things, not just a set of coordinates (and the 
vector basis induced by those coordinates), but also a
set of identifiable axes attached to the body.

If you use the conventional aviation body axes,
i.e. X=forward, Y=starboard, Z=belly
then the standard orientation, achieved by aligning the
body axes with the ECEF axes, corresponds to flying at
(lat,lon) = (0,0) with
  nose = vertically up
  starboard wingtip = east
  belly = north

> After this, the rotation from an X-forward Z-down frame to the OpenGL
> Z-back Y-up frame is added in.

I agree with that ... except perhaps for the words "after
this".  My point here is that viewmgr.cxx converts to OpenGL
coordinates fairly early ... and in particular Erik's new
code passes around the OpenGL representation and does lots
of calculations using that representation.  Quite understandably,
he found some of this surprising and confusing.

In particular, if you align the OpenGL axes 
i.e. Xprime=starboard, Yprime=top, Zprime=aft
with the ECEF axes, then you get exactly the orientation 
described in my previous note and quoted above.  It may 
seem implausible, unconventional, and/or inconvenient, 
but it *is* what the code is using.

The more unconventional and implausible something is,
the more important it is to document it.  My recent
patch contains a bunch of explanatory comments.

Also, in my recent patch, I took steps to cancel out
the OpenGL transformation, so that the exposed quats
use the conventional aviation body axes.  This should
make it easier to interpret the displayed properties.  
I realize most folks were not born with the ability 
to look at a quat and understand what it means, but 
it is a skill that can be learned.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to