Hi Robert,

I get some artifact when doing what you suggested. Here is my scene and the
setup - a composite viewer with one mirrored view

osg::Group* rootForMainView;
osg::Group* rootForMirroredView;

osg::Group* scenel

rootForMainView->addChild(scene);
rootForMirroredView->addChild(scene);

rootForMainView->getOrCreateStateSet()->setAttributeAndModes( new
osg::FrontFace, osg::StateAttribute::ON );
rootForMirroredView->getOrCreateStateSet()->setAttributeAndModes( new
osg::FrontFace(osg::FrontFace::CLOCKWISE, osg::StateAttribute::ON );

viewer->getView(0)->setSceneData(rootForMainView);
viewer->getView(1)->setSceneData(rootForMirroredView);

now, with this setup, the mirror is displayed ok, but the main view is wrong
- looks like CLOCKWISE affect it too, so all the faces are flipped.

Any clue?

Nick


-Nick


On Mon, Mar 15, 2010 at 2:59 PM, Robert Osfield <[email protected]>wrote:

> Hi Nick,
>
> On Mon, Mar 15, 2010 at 12:55 PM, Trajce (Nick) Nikolov
> <[email protected]> wrote:
> > Hi community,
> > is there a way to flip (mirror along the x axis) a view in a composite
> > viewer?
>
> Just flip the left/right values of the projection matrix.  If face
> culling is enabled then you'll need to swap the face that gets culled
> using osg::FrontFace.
>
> Robert.
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to