|
From: Doug M. <mc...@ia...> - 2009-10-25 17:12:24
|
Hello Miroslav, On Oct 23, 2009, at 9:44 AM, Miroslav Andel wrote: > Hi again, > > How do I get the current viewport using osg and VR juggler? Before I > started to port a project from openGL to OSG I used the following > piece of code: > > vrj::GlUserData * userData = vrj::GlDrawManager::instance()- > >currentUserData(); > vrj::Viewport * vp = userData->getViewport(); The code above should work for OSG. VR Juggler abstracts this interface with the underlying windowing API so the code should be the same across scenegraphs and OpenGL. What is the problem you are having with the code above with OSG? > > I’m using each viewport’s size and offset to create a 3D ray from > the mouse position for picking when using multiple viewports in a > window. I have looked in the programmers reference but have not > found anything helpful. You can do this but you have to manage the interface between your viewports and OSG. > > Another question.. If multiple windows are used, configSceneView() > seems only to run in the first window. If I set the clear color for > example then it’s only set in the first window. Is there a way to > configure sceneView in a multi-window setup? What is specifically failing when you are trying to run with multiple contexts? We use this functionality of VR Juggler with OSG without many problems. I think providing more details with regards to your specific problems might be useful. Doug |