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
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
On 22 March 2018 at 09:53, Florian GOLESTIN <> wrote:
Hi everyone !
I don't get why in GLSL you transform a vertex like this:
vec4 result = matrix * vertex;
While in OSG I have to do it in the reverse order :
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:
Post generated by Mail2Forum