Hi all,

i'm trying to setup an OpenSG application that displays one camera on one 
computer and another independent camera on another.

My approach was to a use simple window die render the first camera on my main 
application and to use a second window (MultiDisplayWindow) to render the 
second camera on a different computer. 
Rendering the first cam works as usual. But when I add the multidisplaywindow, 
I get the following errors:

WARNING:  Can't find container id:206   --> Once

WARNING:  Viewport::render: no root!    --> IN each render call at the cluster 
server

The curious thing is that this worked a few weeks ago. :-(

Here's my code:

Client:
        this->multiWindow = MultiDisplayWindow::create();
        beginEditCP(this->multiWindow);
        {
                this->multiWindow->setConnectionType("Multicast");
                this->multiWindow->getServers().push_back("multitouch");
        }
        endEditCP(this->multiWindow);

        this->multiWindow->init();

        NodePtr scene = ... // get from our main app
        
        beaconTransform = ComponentTransform::create();
        beaconNode = Node::create();
        beginEditCP(beaconNode);
                beaconNode->setCore(beaconTransform);
        endEditCP(beaconNode);
        
        beginEditCP( scene->getRoot() );
                scene->addChild(beaconNode);
        endEditCP( scene->getRoot() );

        this->camera = OrthographicCamera::create();
        beginEditCP(this->camera);
                this->camera->setBeacon(beaconNode);
                this->camera->setFar(1000);
                this->camera->setNear(0);
                this->camera->setVerticalSize(1000);
                this->camera->setHorizontalSize(1000);
                this->camera->setAspect(1.0f);
        endEditCP(this->camera);

        //this->viewport = Viewport::create();
        ViewportPtr viewport = Viewport::create();
        beginEditCP(viewport);
                viewport->setSize(0.0f, 0.0f, 1.0f, 1.0f);
                viewport->setCamera(this->camera);
                
                if(scene)
                {
                        viewport->setRoot(scene);
                }
                else
                        viewport->setRoot(NullFC);

                viewport->setBackground(SolidBackground::create());
        endEditCP(viewport);

        beginEditCP(this->multiWindow);
                this->multiWindow->addPort(viewport);
        endEditCP(this->multiWindow);

Server: 

ChangeList::setReadWriteDefault();
        
        // init OpenSG
        osgInit(argc, argv);

        winid = glutCreateWindow(name);
        if(fullscreen)
            glutFullScreen();
        glutDisplayFunc(display);       
        glutIdleFunc(display);
        glutReshapeFunc(reshape);       
        glutSetCursor(GLUT_CURSOR_NONE);

        glEnable( GL_LIGHTING );
        glEnable( GL_LIGHT0 );
        glEnable( GL_NORMALIZE );

        // create the render action
        ract=RenderAction::create();
                ract->setSortTrans(true);
                ract->setZWriteTrans(true);
                ract->setLocalLights(true);
                ract->setFrustumCulling(false);
                ract->setStateSorting(true);

        // setup the OpenSG Glut window
        window     = GLUTWindow::create();
        window->setId(winid);
        window->init();

                // Init der Contrib.dll
                CGFXMaterialPtr dummy = CGFXMaterial::create(); 
                addRefCP(dummy);
                subRefCP(dummy);

        // create the cluster server
        server     = new ClusterServer(window,name,connectionType,address);
        // start the server
        server->start();

         // enter glut main loop
        glutMainLoop();



Thanks for your help,
Michael

P.S. I'm using OpenSG 1.8

-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to