Tim Moore wrote: > On Thu, Dec 2, 2010 at 9:18 AM, Fred Smith < ()> wrote: > > > Hi, > > > > In a drawable cull callback, I have found that State::getModelViewMatrix() > > and State::getProjectionMatrix() are different from the matrices returned > > by Camera::getViewMatrix() and Camera::getProjectionMatrix(). > > > > > Very few, if any, things in the State object are valid during the cull > traversal. They could be changed asynchronously by the draw traversal in > another thread, for example. You want the CullVisitor (actually, CullStack) > methods getModelViewMatrix() and getProjectionMatrix(), which give you the > concatenated matrices at that point in the scene graph. > > > Also, as Fred said, the View matrix is not the same as the ModelView matrix.
Thanks for your replies. ModelView is a bit misleading, but if you mean the difference between the drawable's model-space matrix and the view-space matrix, I follow you. Maybe I should put the question this way: in my cull callback, how can I access the View matrix, i.e. the view space <-> world space matrix? Anyway, I understand from your messages that one simple way to do it is the following: - cast NodeVisitor to CullVisitor (this was the bit I wasn't looking at. I am now assuming this is OK to do this, eg. this will always remain valid in future OSG versions) - call CullVisitor::getCurrentCamera() - use usual Camera methods. ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=34395#34395 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

