Thank you Robert, your message help me.

And I have another problem, I don't know how to correctly set the 2nd camera 
like mirror (smaller viewport with tank_des.osg). What shall i do for correct 
view?  Let's see screenshot below. Scene and car1 in my 3d world are in .ive 
format and structure is created these way:

viewer
_|
_| - camera master  (viewer->setCamera)
_| - camera slave (viewer->addSlave)

root [osg::Group* root;]
_|
_| - light source [root->addChild (pLightsource);]
_| - fog [root->setStateSet(myst);]
_| - static node - scene
_| - dynamicobj [osg::Group * dynamicobj;]
__| - positioned - node - car 1
__| - positioned - node - car 2


main eye position (setViewMatrixAsLookAt)
x:0.0f ... y:0.0f ... z:1.5f

2nd eye position  (setViewMatrixAsLookAt)
x:0.0f ... y:0.0f ... z:2.5f


model1 position:
x:0.0f ... y:15.0f ... z:0.0f

model2 position (tank):
x:0.0f ... y:-15.0f ... z:0.0f

screenshot is here:
[Image: http://www.jkzsim.cz/petr/screenshot-cams.jpg ]


example camera with cow.osg (mirrored 2nd camera) works well, but these 
settings in my scene not ...


Code:
osg::Matrixf mf;
                if (i != 2)
                {
                        mf=osg::Matrix::scale(aspectRatioScale, 1.0, 1.0) * 
osg::Matrix::translate(translate_x, 0.0, 0.0);
                        viewer.addSlave( camera.get(), mf, osg::Matrix() ); 
                }
        else 
                {
                        mf=osg::Matrix::scale(-1.0 * aspectRatioScale, 1.0, 
1.0) * osg::Matrix::translate(translate_x, 0.0, 0.0);
                        viewer.addSlave( camera.get(), mf, osg::Matrix() ); 
                }       


Thanks a lot for answers.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=9531#9531





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

Reply via email to