[osg-users] World Coordinates

Kim C Bale K.Bale at hull.ac.uk
Fri Jul 25 08:22:18 PDT 2008


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.

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080725/2a279453/attachment-0002.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080725/2a279453/attachment-0002.txt>


More information about the osg-users mailing list