Hi Glenn Waldron,

Thanks! I solved my probelm and I understand why it'not always commutative.

I think the right order of the multiplication is gl_ProjectionMatrix * 
gl_ModelViewMatrix  * gl_Vertex. I tried in shaders both orders of the 
multiplication, it turns out that gl_Position = gl_ProjectionMatrix * 
gl_ModelViewMatrix  * gl_Vertex gives the correct scene while the other order 
gives the wrong scene.

Thank you for the answer :)
Cheers,
Ying

[quote="gwaldron"]Ying,Matrix multiplication is not always commutative:


http://math.stackexchange.com/questions/170241/when-is-matrix-multiplication-commutative
 
(http://math.stackexchange.com/questions/170241/when-is-matrix-multiplication-commutative)


If the values are out of range, it may be because your point lies outside the 
projection matrix near and far range. You can call


double fovy, ar, znear, zfar;
projectionMat.getPerspective(fovy, ar, znear, zfar);


to check the values.


 

Glenn Waldron / @glennwaldron

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=60456#60456





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to