[vtkusers] Stereo rendering problem with OpenGL2

Leucht, Nicola Nicola.Leucht at karlstorz.com
Thu Apr 23 07:40:15 EDT 2015


Von: Aashish Chaudhary [mailto:aashish.chaudhary at kitware.com]
Gesendet: Donnerstag, 23. April 2015 13:36
An: Leucht, Nicola
Cc: vtkusers at vtk.org
Betreff: Re: [vtkusers] Stereo rendering problem with OpenGL2

Your code looks fine. Can you post a screen capture of what you see?

- Aashish

On Thu, Apr 23, 2015 at 7:20 AM, Leucht, Nicola <Nicola.Leucht at karlstorz.com<mailto:Nicola.Leucht at karlstorz.com>> wrote:
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

_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers



--
| Aashish Chaudhary
| Technical Leader
| Kitware Inc.
| http://www.kitware.com/company/team/chaudhary.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150423/faca7ccd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stereo.png
Type: image/png
Size: 12550 bytes
Desc: stereo.png
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150423/faca7ccd/attachment.png>


More information about the vtkusers mailing list