[osg-users] What coordinate system does OSG use?

Robert Osfield robert.osfield at gmail.com
Tue Apr 10 12:56:29 PDT 2018


There is nothing magical about what the OSG does.  It just loads data, sets
up the camera view and project matrices that you application sets and
passes them to OpenGL without any modifications.

Now if you are loading data for standard OSG plugoins like OpenFlight then
these models will be loaded in world coords where Z is up, Y is north, X is
east, and the OSG camera manipulators default to this convention so they
set the view so it looks north, Z up, X to the right.

OpenGL coordinate frame is not a fixed thing, the coordinate frame that
objects are in depends upon their modelview matrix.  The only thing that is
fixed in OpenGL coordinate frames is the eye coordinate frame that is Y up,
X to the right and Z out from the screen.  Eye coordinates and world
coordinates are a very different thing though and you shouldn't conflate
the two.  It sounds like to me like you assume that OpenGL eye coordinates
is what all OpenGL coordinate fame are.   I'm afraid this is just a common
misconception about coordinate frames in OpenGL and real time graphics in
general.

As to what to suggest for you it's difficult to guess what you do and don't
know about OpenGL, the OSG and graphics in general, so it's hard to know
where to start when explain stuff.

Robert.

On 10 April 2018 at 21:03, Rowley, Marlin R <marlin.r.rowley at lmco.com>
wrote:

> Hello,
>
>
>
> I’m very confused by this coordinate system.  It appears that our
> conventional left-handed and right-handed systems are NOT used, which
> causes havoc with the OpenGL coordinate frame.
>
>
>
> It seems like getting the view matrix at the origin looking down what
> would be a left-handed +z-axis but rotated 90-degress about the x-axis so
> that z is pointing up seems to be the coordinate frame.
>
>
>
> In a function call for getting the view matrix from a camera, for example.
> You get these values for the matrix (assuming it’s *column-major* order)
>
>
>
> Mat[2] : [0, -1, 0] ç LOOK
>
> Mat[1]: [0, 0, 1] çUP
>
> Mat[0]: [1, 0, 0] ç RIGHT
>
>
>
> This is confusing me with getting transforms and moving them into the
> vertex shaders.
>
>
>
> -M
>
>
>
> ----------------------------------------
>
> Marlin Rowley
>
> Software Engineer, Staff
>
> [image: cid:image002.jpg at 01D39374.DEC5A2E0]
>
> *Missiles and Fire Control*
>
> 972-603-1931 (office)
>
> 214-926-0622 (mobile)
>
> marlin.r.rowley at lmco.com
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180410/969672b4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 3114 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180410/969672b4/attachment.jpg>


More information about the osg-users mailing list