Good news! I was wrong. :-)

Turns out that osg::computeLocalToWorld _does_ ignore Camera nodes. I've now added support for SceneView anaglyphic stereo to osgWorks' AbsoluteModelTransform.

However, I've disabled this by default. The new solution for computing the view matrix requires a NodePath copy, traversal, and matrix inversion, which is much less efficient than the old solution (simply querying it from the Camera). To enable the new code, check the OSGWORKS_SCENEVIEW_ANAGLYPHIC_STEREO_SUPPORT CMake variable.

This is checked in to osgWorks svn trunk. See osgworks.googlecode.com for more 
info.

Sorry for filibustering on this; thanks for bringing the issue to my attention, and also the suggested fix.
   -Paul



On 9/24/2010 11:23 AM, Paul Martz wrote:
(Posting to osgworks-users, as it is where the discussion actually belongs.)

On 9/24/2010 11:03 AM, Johannes Scholz wrote:
Hi Paul,

did you have time to try the solution from Sergey, yet?

Otherwise I would try it myself next week, when I'm back in the office.

I've thought about it. His suggestion assumes that computeLocalToWorld will
contain only model (non-view) transformations. This is an invalid assumption if
the scene graph contains Camera nodes.

I imagine we could have logic like this:
Check the NodePath for the presence of Camera nodes.
If Camera nodes are present in the path
Get the view matrix as in existing code
else do as Sergey suggests:
Get the accumulated model transform from the NodePath
View = inverseModel * modelViewMatrix
But this appears to be quite a bit of code bulk to support a corner case usage
situation.

Given that SceneView is deprecated, and there are workarounds available for
anaglyphic stereo, it doesn't appear to me that any change is in order for
osgWorks / osgBullet.

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

Reply via email to