Hi

I think I found the solution in the osg archives as written by Morn?
Pistorius :

Quoting Pistorius"
Hi Hyatt,
> 
> 
> 
> You need to set the cull mask for each camera (sceneview) and then set
nodemasks for each hud accordingly. Eg:
> 
> 
> 
> //set Cull masks used to exclude HUDs from PIP view
> 
> int inheritanceMask =
(osgUtil::SceneView::VariablesMask::ALL_VARIABLES &
~osgUtil::SceneView::VariablesMask::CULL_MASK);
> 
>
viewer.getSceneHandlerList()[0]->getSceneView()->setInheritanceMask(inheritanceMask);
> 
> viewer.getSceneHandlerList()[0]->getSceneView()->setCullMask(1);
> 
>
viewer.getSceneHandlerList()[1]->getSceneView()->setInheritanceMask(inheritanceMask);
> 
> viewer.getSceneHandlerList()[1]->getSceneView()->setCullMask(2);
> 
> 
> 
> Now to show a hud on only the second camera, set it's node mask:
> 
> hud->setNodeMask(2)
"

Regards
Tristan

On Thu, 2006-11-16 at 14:57 +0200, Tristan McMillan wrote:
> Hi 
> 
> I had a look at the example, and I'm still having trouble.
> 
> The main reason for this is that I'm using Producer directly to setup
> the multiple windows by using the code shown below:
> "
> Producer::CameraConfig* setupCameras()
> {
>    motionCameraConfig = new Producer::CameraConfig();
>    Producer::Camera* motionCameras[3];
> 
>    std::string cameraNames[3];
>    cameraNames[0]= "Main";
>    cameraNames[1]= "Missile";
>    cameraNames[2]= "Target";
>   
>    for (int i = 0; i < 3; i++)
>    {
>       motionCameras[i] = new Producer::Camera();
>       motionCameras[i]->getLens()->setAutoAspect(true);
>       motionCameras[i]->setShareLens(false);
>       motionCameraConfig->addCamera(cameraNames[i],motionCameras[i]);
>    }
>    
>    motionCameras[MAIN_CAMERA]-> setProjectionRectangle(0.05f, 0.95f,
> 0.4f, 0.95f);//x,y, width, height
>    motionCameras[MISSILE_CAMERA]-> setProjectionRectangle(0.05, 0.45,
> 0.05f, 0.35);
>    motionCameras[TARGET_CAMERA]->  setProjectionRectangle(0.5f, 0.95f,
> 0.05f, 0.35f);
> 
>    Producer::RenderSurface* rsOne =
> motionCameras[MAIN_CAMERA]->getRenderSurface();
> 
>    // set the number of screens
>    rsOne->setScreenNum(0);
> 
>    // set the window title bar caption
>    rsOne->setWindowName("Missile _Viewer");
> 
>    // set the window client size
>    rsOne->setWindowRectangle(0,0,screenWidth,screenHeight);//width then
> height
> 
>    // set the camera position
> 
> motionCameras[MAIN_CAMERA]->setViewByLookat(Producer::Vec3(0.0f,0.0f,-6.0f),Producer::Vec3(0.0f,0.0f,0.0f),
>   Producer::Vec3(0.0f,1.0f,0.0f));
> 
>    motionCameras[MISSILE_CAMERA]->setRenderSurface( rsOne );
>    motionCameras[TARGET_CAMERA]->setRenderSurface( rsOne );
> 
>    return motionCameraConfig; 
> }
> "
> I can access the Producer camera using
> 
> motionCameras->findCamera("Target")
> However there are no methods for adding a geode to the camera.
> 
> Is there a way around this?
> 
> I think its more lack of understanding on my side that is giving the
> issues. 
> 
> Thanks 
> Tristan
> 
> 
> On Thu, 2006-11-16 at 09:18 +0000, Robert Osfield wrote:
> > Hi Tristan,
> > 
> > There is an osghud example that uses an osg::CameraNode inserted into
> > the scene graph.  Perhaps will suit your purpose.
> > 
> > Robert.
> > 
> > On 11/16/06, Tristan McMillan <[EMAIL PROTECTED]> wrote:
> > > Hi Osg Users
> > >
> > > I'm having a bit of a problem. I'm trying to place a HUD and text in one
> > > camera view. However, I have been unable to find how to go about doing
> > > this.
> > >
> > > My current code, as working from the multiple camera example, received
> > > the NPS tutorials website
> > > (http://www.nps.navy.mil/cs/sullivan/osgtutorials/index.htm), places a
> > > hud within each subordinate camera.
> > >
> > > I think I need to link it to the camera window, but I'm not sure how to
> > > do this. I've looked through the Producer camera class but can't find a
> > > method that seems to work for me.
> > >
> > > Thanks
> > > Tristan
> > >
> > > _______________________________________________
> > > osg-users mailing list
> > > [email protected]
> > > http://openscenegraph.net/mailman/listinfo/osg-users
> > > http://www.openscenegraph.org/
> > >
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> > http://openscenegraph.net/mailman/listinfo/osg-users
> > http://www.openscenegraph.org/
> 
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to