On 5/26/07, Tim Moore wrote:
You might not realize that OSG doesn't push / pop the matrix in each
transform node to OpenGL. Instead, it accumulates the effective
ModelView matrix for each drawable and and loads that when the drawable
is rendered. This allows you to keep the coordinates of geometry as
small values that comfortably fit in floats, relative to a transform
that can have a very large (wgs84) translation. If the eyepoint is in
wgs84 too, then the effective translation calculated by OSG won't be
very large -- it's effectively limited by the visual range -- and will
also fit nicely in a float.
As Mathias says, this is much more convenient than a scheme where you
translate all the tiles each frame relative to an eyepoint at 0.
I doubt you can measure any difference between glLoadMatrixf and
glLoadMatrixd.
If this works as well as advertised (and it appears to) then this is a
really nice feature of OSG. Dealing with whole earth scales using floating
point numbers requires a few non-obvious tricks. For those not familiar
with the issue, a floating point number can represent about 7(-8?)
significant digits. The est-epsilon program in the tests directory of the
FlightGear source estimates the smallest floating point number that can be
represented.
In practical terms, this means you run out of floating point precision
trying to accurately place yourself or objects on the surface of the world.
You could easily a several meter shift in the position of objects (or the
view point) depending on whether or not the results of your placement math
gets rounded up or rounded down.
You can just use doubles because *everything* that opengl does uses floating
point math.
This leads to scenery that will jitter back and forth by this amount as you
move. It's a huge problem for flight simulators, unless you are studying
alchohol effects on pilots or something. :-)
OSG appears to have come up with a nice workaround/solution to the problem.
Cool ...
Curt.
--
Curtis Olson - University of Minnesota - FlightGear Project
http://baron.flightgear.org/~curt/ http://www.humanfirst.umn.edu/
http://www.flightgear.org
Unique text: 2f585eeea02e2c79d7b1d8c4963bae2d
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel