[osg-users] LookAt() function parameter meanings..

Robert Osfield robert.osfield at gmail.com
Mon Aug 13 08:19:37 PDT 2018


The OSG's LookAt implementation is *exactly* the same as gluLookAt,
the parameters and the maths are all identical.  I made sure this was
the case to enable users to map GL code across easily as well as for
us to be able to leverage existing GL documentation.

The core OSG doesn't have a fixed "up" direction, but the by
convention the viewer, camera manipulators and most of the loaders
follow the convention that WORLD coordinates are +ve Z up, +ve Y
north, and +ve X east.

When you read OpenGL docs it will describe the EYE coordinates being
+ve Y up, +ve Z out, +ve X to the right.

The key thing to remember that EYE and WORLD coordinates and separated
by the View transform matrix.   If this View matrix is Identity then
EYE and WORD orientation are the same, but this is only a special case
as soon as the eye moves through the scene this orientation
consistency is broken.

This is fundamental issue in compute graphics to get your head around,
EYE coordinates and WORLD coords are decoupled, when you think about
what you are doing and what coordinate frame you have you need to know
up front are your world in WORLD coordinates or EYE coordinates.

Another layer upon this is the we have transforms in the scene that
introduce LOCAL coordinates that nest within the WORLD coordinates.
This transforms decouple the LOCAL and WORLD coordinates, so local up
etc. can be very different between WORLD and LOCAL coords - think a
wheel on a car, it doesn't matter than the local up is spinning around
every frame.

Robert.


More information about the osg-users mailing list