Hi,

The original code is :


Code:
vPosition = ViewMatrix * ModelMatrix * vec4(Vertex * ModelScale, 1.0); 



So I think you can use this :


Code:
vPosition = osg_ModelViewMatrix * vec4(Vertex * ModelScale, 1.0); 



because "osg_ModelViewMatrix" is equivalent to "ViewMatrix * ModelMatrix".



> Where i can find all the osg built-in variables? 


In "State.cpp" : look for "osg_*", you'll find :

- osg_ModelViewMatrix => equivalent to gl_ModelViewMatrix
- osg_ModelViewProjectionMatrix => equivalent to gl_ModelViewProjectionMatrix
- osg_ProjectionMatrix => equivalent to gl_ProjectionMatrix
- osg_NormalMatrix => equivalent to gl_NormalMatrix

In "SceneView.cpp" : look for "osg_*", you'll find :

- osg_ViewMatrix
- osg_ViewMatrixInverse


Cheers,
Aurelien

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





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

Reply via email to