[osg-users] Stuck with applying an offset to projection matrix

Werner Modenbach Werner.Modenbach at texion.eu
Mon Jun 25 03:10:46 PDT 2018


Hi all,

I'm experimenting with slave cameras for a while now and now I'm totally
stuck.
I'm doing a tiled display of a scene and for the main scene graph it
works fine with projection offset matrix on the slave cameras
and all cameras having a RELATIVE reference frame.
But my scene also has cameras with ABSOLUTE reference frame (i.e. a
background image).
The background is - of course - fully mapped on each tile.

In order to solve this I modified my vertex shader like that:

   
gl_Position=osg_ModelViewProjectionMatrix*projectionOffsetMatrix*osg_Vertex;


and I populate the projection offset matrix via uniform (same as slave
offset matrix). Unfortunately without the expected success.

For creation of osg_ModelViewPrtojectionMatrix I found this code:

    osg::Matrixd modelViewProjectionMatrix = modelMatrix * viewMatrix *
_camera->getProjectionMatrix();
    uniform->set(modelViewProjectionMatrix);

And in the updateSlaveImplementatiuon I see:

    _camera->setProjectionMatrix(view.getCamera()->getProjectionMatrix()
* _projectionOffset);

So where is my mistake? It should be obvious but it seems I'm blind here.

Many thanks

- Werner -






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180625/be6467fe/attachment.html>


More information about the osg-users mailing list