[vtk-developers] Passive stereo visualization with legacy graphics card

Michael Scarpa m.scarpa at uva.nl
Tue Dec 5 06:30:48 EST 2006


Hi Valeria.
> I need a double-wide render window where in a half there is the  
> left eye view and in the other half there is the right eye view.
I believe you can achieve what you are trying to do by simply using  
two renderers in the same render window, and offsetting the two  
cameras accordingly to where you want the left and the right eye to  
be in your scene.  Here's a simple Python script that does what you  
describe:

import vtk

renWin = vtk.vtkRenderWindow()

renL = vtk.vtkRenderer() # Left eye renderer.
renL.SetViewport(0, 0, 0.5, 1)
renL.SetBackground(1, 0, 0)
renL.GetActiveCamera().SetPosition(-1, 0, 5) # Exagerated offset.
renWin.AddRenderer(renL)
renR = vtk.vtkRenderer() # Right eye renderer.
renR.SetViewport(0.5, 0, 1, 1)
renR.SetBackground(0, 0, 1)
renR.GetActiveCamera().SetPosition(1, 0, 5) # Exagerated offset.
renWin.AddRenderer(renR)

cs = vtk.vtkConeSource()
cm = vtk.vtkPolyDataMapper()
cm.SetInputConnection(cs.GetOutputPort())
ca = vtk.vtkActor()
ca.SetMapper(cm)

renL.AddViewProp(ca)
renR.AddViewProp(ca)

renL.ResetCameraClippingRange()
renR.ResetCameraClippingRange()

iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
iren.Initialize()
iren.Start()

If you run this, you will see two renderers in one window, each  
taking up one horizontal half of the window.  I changed the  
background colors to exemplify the two renderers.  Each renderer  
shows the same prop (a cone), but each renderer's camera has been  
moved (one to the left and one to the right), so that they show the  
cone from two different points of view.  I hope this helps.

One note: the two renderers do act independently when it comes to the  
render window interactor.  I don't know if it is possible to set the  
interactor and/or the renderers such that the events on one renderer  
are replicated onto the other.

With kind regards,

Michael


On 4 Dec, 2006, at 17:36, Valeria Gallo wrote:

> Hi, i work in a research center in Italy.
>
> Here I’m trying to generate 3d models of human parts that can be  
> viewed in stereoscopy (SIDE-BY-SIDE stereo - passive stereo based  
> on polarization) using only the VTK libraries.
>
> Our hardware configuration is very similar to the Geowall system: 2  
> projectors with polarized lens (linear) – polarized glasses.
>
>
>
> I’ve read that with vtk, to generate two different scenes, I have  
> to use the CrystalEyes stereo mode, but I will need a graphics card  
> like the Nvidia Quadro (quad buffered + clone mode) to split the  
> two different views on the two projectors (with a refresh rate >  
> 100 Hz). But my card is a WildCat II 5110, and this model doesn’t  
> support the quad buffered mode and the clone mode, the max  
> available refresh rate is 90 Hz; it supports only the double-wide  
> screen.
>
>
>
> Is there a way to configure vtk to generate the two render windows  
> on the two projectors connected to the card?
>
> I need a double-wide render window where in a half there is the  
> left eye view and in the other half there is the right eye view.
>
> Or have I to manually extend the vtkRenderWindow class to support a  
> side-by-side stereo (manually managing the two different views)?
>
>
>
> I hope someone could address me to the correct solution.
>
>
>
> Thx in advance
>
> Valeria
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers




More information about the vtk-developers mailing list