[vtkusers] Stereo rendering problem with OpenGL2

Leucht, Nicola Nicola.Leucht at karlstorz.com
Thu Apr 23 07:20:57 EDT 2015


Hi,

I'm using VTK 6.2.0 with the OpenGL2 backend.
When rendering in stereo (interlaced mode), there are two horizontal lines in the middle of the window that belong to one eye.

Code:
vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
renderWindow->AddRenderer(renderer);
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
renderWindowInteractor->SetRenderWindow(renderWindow);

vtkSmartPointer<vtkSphereSource> sphereSource = vtkSmartPointer<vtkSphereSource>::New();
sphereSource->SetCenter(0.0, 0.0, 0.0);
sphereSource->SetRadius(50.0);
sphereSource->SetPhiResolution(100);
sphereSource->SetThetaResolution(100);
vtkSmartPointer<vtkOpenGLPolyDataMapper> mapper = vtkSmartPointer<vtkOpenGLPolyDataMapper>::New();
mapper->SetInputConnection(sphereSource->GetOutputPort());

vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
actor->SetMapper(mapper);
mapper->Update();
renderer->AddActor(actor);
renderer->GetActiveCamera()->SetEyeAngle(30);
renderer->ResetCamera();
renderer->SetBackground(.3, .6, .3);
renderWindow->StereoCapableWindowOn();
renderWindow->SetStereoTypeToInterlaced();
renderWindow->StereoRenderOn();
renderWindowInteractor->Start();

Is there anything I need to change in my code?

Kind regards
Nicola
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150423/7de3a48c/attachment.html>


More information about the vtkusers mailing list