Hi, I build a indoor scene using osg2.4. Each object added to the scene is added to a MatrixTransform(mt) node which containing all the information of translation,rotation and so on, this MatrixTransform node is then added to the root.
Since the matrix contains the information about position of the node, I send this matrix(ModelWorld = mt->getMatrix()) to the vertex shader to get the world position of the vertex, but the result of gl_Vertex * ModelWorld in glsl seems not the world position of the vertex. So I have many problems: 1. Does gl_Vertex in glsl has any relationship with the matrix of MatrixTransform which the node added to in osg? Can I say that gl_Vertex is just the local coordinate of the vertex of the node? 2. I think this matrix do translate the object to world space, but why gl_Vertex * ModelWorld is not the world position of the vertex? 3. As is known to all , gl_ModelViewMatrix in glsl translate the vertex from local space to eye space, I want to know how does osg use this matrix (getMatrix from MatrixTransform) to translate the object to world space and then how does it combined with view matrix to get the modelviewmatrix that we get in glsl in the form of gl_ModelViewMatrix. Thanks very much! guilianzhang 2008-06-29
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org