On 9/19/06, Elk, M.G. (Michel) van <[EMAIL PROTECTED]> wrote:
THis is severe. Try toggling between singleThreaded and ThreadPerCamera arguments to viewer.realize()
What is "wanted" behavior, that a) keyboard mouse handler be active on both windows? If so, you need an InputArea in your config. or b) that the keyboard mouse handler only change the view on one window. If so, call setShareView(false) on the second camera.
Hi Don, thank you for your solution.I have re-written your config into code, I create one cameraconfig and add two camera's withrendersurfaces to it. Then I create one viewer, using the cameraconfig.Here's the code:Producer::CameraConfig *cfg = new Producer::CameraConfig;
Producer::Camera *camera1 = new Producer::Camera;
Producer::RenderSurface *rs1 = new Producer::RenderSurface;
rs1->setWindowRectangle(20,20,320,240);
rs1->setWindowName("Render Window 1");
camera1->setRenderSurface(rs1);
cfg->addCamera("Camera1",camera1);Producer::Camera *camera2 = new Producer::Camera;
Producer::RenderSurface *rs2 = new Producer::RenderSurface;
rs2->setWindowRectangle(400,20,320,240);
rs2->setWindowName("Render Window 2");
camera2->setRenderSurface(rs2);
cfg->addCamera("Camera2",camera2);osgProducer::Viewer viewer1(cfg);
viewer1.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS);
viewer1.realize();I notice two things:1) the performance drops dramatically, 20 FPS for 1 window, 1.50 FPS for 2 windows
THis is severe. Try toggling between singleThreaded and ThreadPerCamera arguments to viewer.realize()
2) both windows react to the same mouse/keyboard handler (only active on one window) which isunwanted behaviour for me.
What is "wanted" behavior, that a) keyboard mouse handler be active on both windows? If so, you need an InputArea in your config. or b) that the keyboard mouse handler only change the view on one window. If so, call setShareView(false) on the second camera.
Is it correct to say that 2) cannot be solved since an eventhandler is part of a viewer and notof a camera?Thanks,
Michel
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Don Burns
Sent: maandag 18 september 2006 18:33
To: osg users
Subject: Re: [osg-users] sharing GL-contexts and textures, continued ...Two ways to do this:
Cut and past the following into a file named 'twoWindows.cfg':
Camera "Camera 1"
{
RenderSurface "RenderSurface 1"
{
Visual { SetSimple }
Screen 0;
WindowRect 10 10 620 480;
InputRectangle -1.0 0.0 -1.0 1.0;
}
Lens {
Frustum -0.55228475 0.55228475 -0.41421356 0.41421356 1 1000.0;
}
Offset {
Shear 1.0 0.0;
}
}
Camera "Camera 2"
{
RenderSurface "RenderSurface 2"
{
Visual { SetSimple }
Screen 0;
WindowRect 650 10 620 480;
InputRectangle 0.0 1.0 -1.0 1.0;
}
Lens {
Frustum -0.55228475 0.55228475 -0.41421356 0.41421356 1 1000.0;
}
Offset {
Shear -1.0 0.0;
}
}
InputArea
{
RenderSurface "RenderSurface 1";
RenderSurface "RenderSurface 2";
}
Then run:
osgviewer -c twoWindows.cfg cow.osg
2) Create the config file programatically and pass the Producer::CameraConfig to osgProducer::Viewer's constructor.
-don
On 9/18/06, Elk, M.G. (Michel) van <[EMAIL PROTECTED]> wrote:During the discussion on sharing resources between viewers,Don Burns wrote:The use of two viewers (I assume you mean two osgProducer::Viewers), is expected to work as you have experienced. However, applications should use only one viewer with a configuration for multiple windows.My question: How can I create multiple windows using one osgProducer::Viewer?Anyone?Thanks & regards,Michel
This e-mail and its contents are subject to the DISCLAIMER at http://www.tno.nl/disclaimer/email.html
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
This e-mail and its contents are subject to the DISCLAIMER at http://www.tno.nl/disclaimer/email.html
_______________________________________________
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/
