[vtkusers] Question regarding stereo

Sebastian B sebastian at ehmo.org
Sun Jul 10 09:53:00 EDT 2011


 Hello all,
 I am currently attempting write a program using vtk under linux to make 
 use of a pair of active 3D-glasses. The hardware itself works, I have 
 tested it with a simple program 
 (paulbourke.net/miscellaneous/stereographics/stereorender/pulsar.c), but 
 I am unable to get it to work with vtk, below is a small excerpt from my 
 test program:

 this->m_VTKWidgetMesh = new QVTKWidget(this);
 this->m_VTKWidgetMesh->move(0,0);
 this->m_VTKWidgetMesh->resize(800,600);

 this->m_RendererMesh = vtkRenderer::New();

 this->m_VTKWidgetMesh->GetRenderWindow()->FullScreenOn();
 this->m_VTKWidgetMesh->GetRenderWindow()->StereoCapableWindowOn();
 this->m_VTKWidgetMesh->GetRenderWindow()->StereoRenderOn();
 this->m_VTKWidgetMesh->GetRenderWindow()->SetStereoTypeToCrystalEyes();
 this->m_VTKWidgetMesh->GetRenderWindow()->AddRenderer(this->m_RendererMesh);

 this->m_RendererMesh->GetActiveCamera()->ParallelProjectionOff();
 this->m_RendererMesh->GetActiveCamera()->SetEyeAngle(5);

 this->m_Source = vtkSTLReader::New();
 this->m_Source->SetFileName("leber2smooth.stl");

 this->m_Reference = vtkPolyDataMapper::New();
 this->m_Reference->ImmediateModeRenderingOff();
 this->m_Reference->SetInputConnection(this->m_Source->GetOutputPort());
 this->m_Reference->Update();

 this->m_ReferenceActor = vtkActor::New();
 this->m_ReferenceActor->SetMapper(this->m_Reference);
 this->m_ReferenceActor->GetProperty()->SetOpacity(0.5);

 this->m_RendererMesh->AddActor(this->m_ReferenceActor);

 I only see the left (or right) picture on my screen instead of both as 
 it was the case with the demo program. The glasses also show the same 
 image on both eyes. When I use SetStereoTypeToRedBlue() instead of 
 SetStereoTypeToCrystalEyes() I see a composite of the red and blue 
 image, as should be expected.

 Can anyone tell me, what I am doing wrong?

 Thank you!
 Sebastian



More information about the vtkusers mailing list