I'm trying to work out the world coordinates of vertices in my shader,
and I'd like to check my understanding of a few things.
At the moment I manually go through the graph and grabbing the
transformations en-route to the target geode and create the matrix
myself, pass this to the shader, and multiply it by gl_Vertex. That
seems to work fine, although it does involve a lot of faffing.
However I noticed a couple of handy things already built into OSG.
The first is getWorldMatrices; If I call
root->getWorldMatrices(targetGeode) does this achieve the same as above?
Accumulate the transformation matrices up to that geode and form a
matrix?
The second is osg_ViewMatrixInverse. If I simply form a matrix from
osg_ViewMatrixInverse * gl_ModelViewMatrix does this not give me the
same matrix?
I hope that makes sense, thanks for your help.
Kim.
*****************************************************************************************
To view the terms under which this email is distributed, please go to
http://www.hull.ac.uk/legal/email_disclaimer.html
*****************************************************************************************
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org