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

Rowley, Marlin R marlin.r.rowley at lmco.com
Tue Apr 10 13:44:20 PDT 2018


Robert,

The camera manipulators is probably what we are basing our coordinate system off of.  Thanks for the answer there.  I’ll try to remember that going forward.

I understand the model, world, view, projection, divide-by-w, and screen space coordinate transformations.  When dealing with matrices though, you just have either a left or right handed system, row or column major ordering.  I was just a little stumped with how some of these matrices look after going through the model, world, and view space transformations.

It’s going to be hard to be too specific with questions and issues as I’m sure all of us are working on applications that have several library dependencies.  It would be more troublesome to create an example unless we can isolate it by writing another smaller program.  Not saying I wouldn’t, but I think going the general question route first and then getting more specific as we go along without any solution should be OK, right?

Thanks for the quick feedback though! 😊

----------------------------------------
Marlin Rowley
Software Engineer, Staff
[cid:image002.jpg at 01D39374.DEC5A2E0]
Missiles and Fire Control
972-603-1931 (office)
214-926-0622 (mobile)
marlin.r.rowley at lmco.com<mailto:marlin.r.rowley at lmco.com>

From: osg-users [mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Robert Osfield
Sent: Tuesday, April 10, 2018 2:56 PM
To: OpenSceneGraph Users <osg-users at lists.openscenegraph.org>
Subject: EXTERNAL: Re: [osg-users] What coordinate system does OSG use?

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<mailto: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
[cid:image002.jpg at 01D39374.DEC5A2E0]
Missiles and Fire Control
972-603-1931 (office)
214-926-0622 (mobile)
marlin.r.rowley at lmco.com<mailto:marlin.r.rowley at lmco.com>


_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org<mailto: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/bda9994b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 3114 bytes
Desc: image001.jpg
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180410/bda9994b/attachment.jpg>


More information about the osg-users mailing list