[osg-users] Matrix multiplication order

Robert Osfield robert.osfield at gmail.com
Thu Mar 22 04:04:47 PDT 2018


Hi Florian,

The difference is down to history, the OSG is row major chosen very
earliest days of the OSG (back in 2000) and OpenGL 1.x days, and
OpenGL GLSL ended choosing column major a few years later.  The OpenGL
matrices are actually stored the same way as OSG matrices in main
memory.

To change the OSG to be the same convention would have broken user
applications that had already adopted the OSG so I chose not to change
the order once OpenGL GLSL came out.  I now regret not just biting the
bullet and forcing the OSG community to swtich, it would have been
painful, but obviously would have easier for new developers.  However,
now we even more code base that works with the OSG multiplication
order so it would be even more painful to convert across so we are
stuck.

Robert.


On 22 March 2018 at 09:53, Florian GOLESTIN <florian.golestin at gmail.com> wrote:
> Hi everyone !
>
> I don't get why in GLSL you transform a vertex like this:
>
>
> Code:
> vec4 result = matrix * vertex;
>
>
>
> While in OSG I have to do it in the reverse order :
>
>
> Code:
> osg::Vec4 result = vertex * matrix;
>
>
>
> Is it due to the Matrices major mode that are different from OpenGL and OpenSceneGraph ?
>
> Thanks for demystifying me!
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=73145#73145
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


More information about the osg-users mailing list