Oh yes, now I understand it!

I must delegate the functionality to the views. For example:

viewer->setSceneData(...) ...;
MyCompsiteViewer(...){... getView(i)->setSceneData(...); }

And I write a own setUpViewerAsEmbeddedInWindow(...) like that:

GraphicsWindowEmbedded* setUpViewerAsEmbeddedInWindow(int x, int y, int width, 
int height)

{

  setThreadingModel(SingleThreaded);

  osgViewer::GraphicsWindowEmbedded* gw;
  gw = new osgViewer::GraphicsWindowEmbedded(x,y,width,height);


  // camera of the view with id i
  getCamera(i)->setViewport(new osg::Viewport(0,0,width,height));
  double ar = static_cast<double>(width)/static_cast<double>(height);

  getCamera(i)->setProjectionMatrixAsPerspective(30.0f, ar, 1.0f, 10000.0f);

  getCamera(i)->setGraphicsContext(gw);

  return gw;

}

It seems to me that I understand this solution. I try it.

Thanks

Martin

-------- Original-Nachricht --------
> Datum: Fri, 05 Nov 2010 09:46:01 -0400
> Von: "Jean-Sébastien Guay" <jean-sebastien.g...@cm-labs.com>
> An: OpenSceneGraph Users <osg-users@lists.openscenegraph.org>
> Betreff: Re: [osg-users] How can I calculate a matrix via a MatrixManipulator

> Hello Martin,
> 
> > I guess it wouldn't work, because I use the
> setUpViewerAsEmbeddedInWindow(...)-Method of the osgViewer::Viewer. The 
> composite viewer don't have
> this function.
> 
> But that method is not "magical", you can just copy the code from it and 
> do it yourself. All it does AFAIK is create a GraphicsWindowEmbedded and 
> set it on the Viewer's camera. Just do the same, but create your 
> osgViewer::Views and set the context on each of those views' cameras.
> 
> J-S
> -- 
> ______________________________________________________
> Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
>                                 http://www.cm-labs.com/
>                          http://whitestar02.webhop.org/
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to