c++ - Why does the camera not remain child of the other camera after adding it in osg? -
i writing openscenegraph based program uses 2 cameras, 1 render preview user , 1 uses callback make screenshots mrt. exporter camera using orthographic projection , same position same view , vector, whereas preview camera can moved usere.
upon starting program, create preview camera, add shaders it, set viewer , add preview camera it.
afterwards create export camera, add shaders, textures , callback , add export camera child preview camera. point, nothing has been rendered (i.e. no frame
call has been made).
the addchild
call issued (i.e. break point reached in vs, , stepping further can see exporter camera child of preview camera). however, once issue command make screenshot, exporter camera not child of preview camera anymore (by now, few render calls have been made).
why this, , how can fix apart adding exporter camera again?
on sidenote: started using computergraphics.stackexchange.com, question suited side or meant algorithms rather implementations?
if you're using osg::view, has own implementation master , slave cameras - see osg::view headers information or old tutorial example: http://thermalpixel.github.io/osg/2014/02/15/rtt-with-slave-cameras.html
Comments
Post a Comment