Hi Dirk,
i am still struggling after the second viewpor problem.
As you may remember my final goal is to make it run on
my cluster, to simulate the geometric distortion of a 
cilindrical screen and the ovaerlapping between the projections.

In order to achieve this objective, i was thinking about 
adding the second viewport trick to my cluster servers,
so half of the application works as a slave of the client 
(rendering its part of the scene), and half of the app 
uses the obtained buffer to texture the target mesh and
obtaining my desired effect.
I did a little experiment of mixing two programs (the
render to texture and cluster server) but i can't get 
but a crash after another. In a few words I create
a second viewport, add a TextureGrabBackground and
add all this to the main window of the server:

winid = glutCreateWindow(name);

window     = GLUTWindow::create();
    window->setId(winid);
    window->init();
.
.
.

server     = new ClusterServer(window,name,connectionType,"");
    // start the server
    server->start();
.
.
.

ViewportPtr vp2 = Viewport::create();
beginEditCP(vp2);
    vp2->setCamera(cam);
    vp2->setRoot(tr);
    vp2->setBackground(tg);
                                                                                
    vp2->setLeft(0);
    vp2->setRight(1);
    vp2->setBottom(0);
    vp2->setTop(1);
endEditCP(vp2);
                                                                                
beginEditCP(window);
    window->addPort(vp2);
endEditCP(window);


I noticed that the program crashes as soon as i add the second
viewport to the window. 
Probably i am misunderstanding something crucial in the 
rendering pipeline of OSG :)
Does anyone has some clue to offer?

Many thanks,
enrico

Il lun, 2005-05-09 alle 21:59, Dirk Reiners ha scritto:
>       Hi Enrico,
> 
> On Fri, 2005-05-06 at 10:54 +0200, Enrico Borrione wrote:
> > Hi dirk,
> > after playing with the example you pointed me for a bit,
> > i understood the basic principles...
> > Now I am trying to change the textured quad in the 
> > second viewport with a simple geometry (as you suggested).
> > So... I modelled a half tube with blender, 
> > exported it in wrml along with the texture coordinates
> > and tried to use it as the *screen* of the application.
> > Surprise surprise, it isn't working, i just see the 
> > solid background. My best guess is that the matrixcameraptr
> > is pointing in the wrong direction, so i pointlessy looked for a
> > way to move the camera.
> > I used to query the simple scene manager for the navigator
> > and then update the projection matrix all by myself, but
> > in this case i think the navigator is linked to the first vieport...
> 
> Yup.
> 
> > So: how can i update the camera position of the second vp?
> > and the target of the look at?  :)
> 
> The easiest would probably be to create your own Camera and use that in
> the second viewport, which should work just fine.
> 
>       Dirk



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to