Hi all!

I'm still working on my shadow technique for OpenGL 3 shaders.
I only partially manage setting the matrix for the light camera creating the shadowMap.

What I do:
    osg::Vec3lightPositionVS=mainCamera->getViewMatrix()*lightPosition;

osg::Vec3eye;

osg::Vec3center;

osg::Vec3up;

mainCamera->getViewMatrixAsLookAt(eye,center,up,view->getDistance());

shadowDepthCamera->setViewMatrixAsLookAt(center,center+lightPositionVS,up);

That works quite fine except it doesn't honor the manipulations which are
usually done by the model matrix (scaling / translation).
So I guess I should do something like that:
        osg::Vec3lightPositionVS=???->getModelMatrix() * 
mainCamera->getViewMatrix()*lightPosition;

I have references to the view and to the mainCamera.
I found out that the model matrix is held by the cameraManipulator.
Unfortunately I couldn't find and way to get the manipulator from the 
references I have.
Any other things I have to care about?

Or is there any other approach in setting up the shadowDepthCamera?

Any idea?

Thanks

- Werner -

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to