Hi Yura
Hi,

I have a transform matrix and I want to apply it in shader. I pass it into 
uniform and set gl_Position = 
gl_ModelViewProjectionMatrix*my_transfrom_matrix*gl_Vertex.
If I set translate only, everything is ok. If I set translate and scale - 
translate multiplies by scale and transform is wrong (object is too far if 
scale>1.0). If I apply this transform not using shader (by SetMatrix) 
everything is ok. What I am doing wrong?
Matrix multiplication is not cummutative in every case.
Try
gl_Position = gl_ModelViewMatrix * matrix * gl_ProjectionMatrix * gl_Vertex.

Cheers
Sebastian


Thank you!

Cheers,
Yura

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





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

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

Reply via email to