Hello,

I found a Mail from the 09.May.2006 where Marcus Roth answers to a question 
posted by Chuck Bueche.
I am developing quite the same as Chuck did.
I implemented my own framework for initializing the cluster environment and 
successfully tested it
with the stereo example that can be found in the related pages in the api 
documentation.
It even worked with mouse navigation.

Now I followed Marcus's description of what needs to be done in order to set up 
different projection planes.

Marcus answered Chuck:
The MultiDisplayWindow is the right Window to use even for a Cave.
If you have e.g. 10 projectors, then place 10 viewports into the 
MultiDisplayWindow
xxxxxxxxxx
If you have a resolution of 1280x1024 for your projectors, Set the size of the 
MultDisplayWindow to 12800 x 1024.
First Viewport goes form 0,0 - 1279,1023. second from 1280,0 - 2559,1024 , ...
You can adjust the viewports so that they overlap with your projection area.
Assign a root to all viewports.
Assign a different ProjectionCameraDecorator to all viewports and configure the 
projection plane
Assign your camera to all Decorators.

I think I followed the description and replacing the type of the 
ShearedStereoCameraDecorator by
a ProjectionCameraDecorator and then setting up the projection surface had been 
almost everything I did.

But after that my running application crashes with a segmentation fault the 
moment all three windows appear and the first draw is attempted.

Setting H and V servers or not does not change anything just as leaving the 
setNear, setFar, setFov for the Camera.
Setting the Viewports size to relative or absolute values doesn't change a 
thing.
Every single object is initialized, none of the objects points to NullFC, I 
know that for sure.

Does someone of you know what I need to do to get rid of the seg-fault and get 
properly rendered perspectives?
I am grateful for any hint you might have.

Thanks in advance
Lennart

--------------------------------------

Here is what I do:

  beginEditCP(m_clientCamera);
  {
    m_clientCamera->setBeacon(m_client_beacon);
    m_clientCamera->setFov(deg2rad(90));
    m_clientCamera->setNear(0.1);
    m_clientCamera->setFar(100);
  }
  endEditCP(m_clientCamera);

  SolidBackgroundPtr bkg = SolidBackground::create();
  beginEditCP(bkg);
  {
    bkg->setColor(Color3f(0,0,0));
  }
  endEditCP(bkg);

  ViewportPtr leftViewport = Viewport::create();
  ViewportPtr rightViewport = Viewport::create();
    
  ProjectionCameraDecoratorPtr cameraDecorator = 
ProjectionCameraDecorator::create();
  beginEditCP(cameraDecorator);
  {
    cameraDecorator->setLeftEye(true);
    cameraDecorator->setEyeSeparation(0.06);
    cameraDecorator->setDecoratee(m_clientCamera);
    cameraDecorator->getSurface ().push_back (Pnt3f ( 1.f, 1.f,-1.f));
    cameraDecorator->getSurface ().push_back (Pnt3f (-1.f, 1.f,-1.f));
    cameraDecorator->getSurface ().push_back (Pnt3f (-1.f,-1.f,-1.f));
    cameraDecorator->getSurface ().push_back (Pnt3f ( 1.f,-1.f,-1.f));
    beginEditCP(leftViewport);
    {
      leftViewport->setCamera    (cameraDecorator);
      leftViewport->setBackground(bkg);
      leftViewport->setRoot      (m_root);
      leftViewport->setSize      (0,0,639,639);
    }
    endEditCP(leftViewport);
  }
  endEditCP(cameraDecorator);

  cameraDecorator = ProjectionCameraDecorator::create();
  beginEditCP(cameraDecorator);
  {
    cameraDecorator->setLeftEye(false);
    cameraDecorator->setEyeSeparation(0.06);
    cameraDecorator->setDecoratee(m_clientCamera);
    cameraDecorator->getSurface ().push_back (Pnt3f ( 1.f,-1.f,-1.f));
    cameraDecorator->getSurface ().push_back (Pnt3f (-1.f,-1.f,-1.f));
    cameraDecorator->getSurface ().push_back (Pnt3f (-1.f,-1.f, 1.f));
    cameraDecorator->getSurface ().push_back (Pnt3f ( 1.f,-1.f, 1.f));
    beginEditCP(rightViewport);
    {
      rightViewport->setCamera    (cameraDecorator);
      rightViewport->setBackground(bkg);
      rightViewport->setRoot      (m_root);
      rightViewport->setSize      (640,0,1279,639);
    }
    endEditCP(rightViewport);
  }
  endEditCP(cameraDecorator);

  beginEditCP(m_clusterWin);
  {
    m_clusterWin->setConnectionType("Multicast");
    m_clusterWin->getServers().push_back("Server1");
    m_clusterWin->getServers().push_back("Server2");
    m_clusterWin->setSize (1280,640);
    m_clusterWin->addPort(leftViewport);
    m_clusterWin->addPort(rightViewport);
    m_clusterWin->init();
  }
  endEditCP(m_clusterWin);

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to