Title: osgProducer::Viewer default behavior

Hello,


I modified slightly the osgviewer application to add the following hierarchy
on top of the loaded model to allow model and post-process shaders to be applied.
Here is what it looks like:

//  root
//    \
//     post-processing effect (see post-shaded root below)
//     /   \
//   ...    model effect
//           \
//            loaded model 
//
//
//                post-shaded root
//        /              |            ...     \         
//  perspective cam     ortho cam 1         ortho cam n
//       |               |                     |
//  model effect        quad 1        ...      quad n        

Now when I did that I lost the viewer default trackball manipulation and the
'w' wireframe mode.

Two questions:

1. What would be the way to restore the wireframe default mode ?

2. To restore the trackball I did something like:
osg::ref_ptr<osgProducer::KeyboardMouseCallback> kbmcb = viewer.getKeyboardMouseCallback();
osg::ref_ptr<Producer::Trackball> trackball = new Producer::Trackball();
trackball->input( kbmcb->mx(), kbmcb->my(), kbmcb->mbutton() );
osg::CameraNode* pMainCam = const_cast<osg::CameraNode*>(pDemoEffects->GetCurrentPostEffect()->GetSceneCamera());
if(pMainCam != NULL)
   pMainCam->setViewMatrix(osg::Matrixd(trackball->getMatrix().ptr()));

Now this works but the lighting is affected... How can I restore the default behavior ?


Thanks a lot in advance for your suggestions !


guillaume

_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to