[vtkusers] Re: Stereo effect with two projectors and polarized lenses

Nicholas Schwarz schwarz at evl.uic.edu
Thu Jul 22 13:23:38 EDT 2004


There are two ways to get passive stereo using two projectors and VTK.

The easiest way is two set the vtkRenderWindow to use Crystal Eyes stereo
like this

 vtkRenderWindow* renWin = vtkRenderWindow::New();
 renWin -> StereoCapableWindowOn();
 renWin -> StereoRenderOn();
 renWin -> SetStereoTypeToCrystalEyes();
 renWin -> SetSize(600, 600);
 renWin -> AddRenderer(ren);

and use a graphics card, such as the  nVidia Quadro series, that supports
quad buffered stereo. If you have one of these cards and are using
Windows you would set the display mode to Clone, enable stereo in OpenGL,
and set the stereo display mode to nView Clone. These settings are found
in the display properties box.

The harder way is to have a double-wide window that spans a single 
horizontal span desktop. You would have to write code that maintains two
spearate camera positions and draws them to two viewports.

A small example program of the easy way can be found at
http://www.evl.uic.edu/schwarz/stereo.html.

Also, you can visit http://www.geowall.org for more information on basic
projector and hardware setup, as well as screen shots of how to set the
proper display settings.

Nicholas

-----------------------------------------------------------------------
Nicholas Schwarz - Research Assistant
Electronic Visualization Laboratory         E-Mail: schwarz at evl.uic.edu
Department of Computer Science              Telephone: 312-996-3002
University of Illinois at Chicago           Facsimile: 312-413-7585
-----------------------------------------------------------------------


> ------------------------------
> 
> Message: 3
> Date: Thu, 22 Jul 2004 16:41:59 +0200
> From: "trull78yaoo" <trull78yaoo at yahoo.de>
> Subject: [vtkusers] Stereo effect with two projectors and polarized
> 	lenses
> To: <vtkusers at vtk.org>
> Message-ID: <20040722144439.EEA3310934 at public.kitware.com>
> Content-Type: text/plain;	charset="iso-8859-1"
> 
> Hello vtk User!
> 
> I have two projectors with polarized lenses and polarized glasses, and want
> to use it with VTK. My System: WinXP Nvidia GeForce FX 5600. I'm VTK
> beginner and need help to solve this problem in C++. Must i change the
> graphic card or WinXP settings? What function need my short example file?
> Many thanks!
> 
> Joerg Lubnau
> -------------------------------------------------------------
> #include "vtkConeSource.h"
> #include "vtkPolyDataMapper.h"
> #include "vtkRenderWindow.h"
> #include "vtkRenderWindowInteractor.h"
> #include "vtkCamera.h"
> #include "vtkActor.h"
> #include "vtkRenderer.h"
> #include "vtkInteractorStyleTrackballCamera.h"
> 
> int main( int argc, char *argv[] )
> {
>   vtkConeSource *cone = vtkConeSource::New();
>   cone->SetHeight( 3.0 );
>   cone->SetRadius( 1.0 );
>   cone->SetResolution( 10 );
>   
>   vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
>   coneMapper->SetInput( cone->GetOutput() );
> 
>   vtkActor *coneActor = vtkActor::New();
>   coneActor->SetMapper( coneMapper );
> 
>   vtkRenderer *ren1= vtkRenderer::New();
>   ren1->AddActor( coneActor );
>   ren1->SetBackground( 0.1, 0.2, 0.4 );
> 
>   vtkRenderWindow *renWin = vtkRenderWindow::New();
>   renWin->AddRenderer( ren1 );
>   renWin->SetSize( 300, 300 );
> 
>   vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
>   iren->SetRenderWindow(renWin);
> 
>   vtkInteractorStyleTrackballCamera *style = 
>     vtkInteractorStyleTrackballCamera::New();
>   iren->SetInteractorStyle(style);
> 
>   iren->Initialize();
>   iren->Start();
>   
>   cone->Delete();
>   coneMapper->Delete();
>   coneActor->Delete();
>   ren1->Delete();
>   renWin->Delete();
>   iren->Delete();
>   style->Delete();
> 
>   return 0;
> }
> ------------------------------------------------------------------
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Thu, 22 Jul 2004 15:53:36 +0100
> From: Immo Trinks <trinks at esc.cam.ac.uk>
> Subject: Re: [vtkusers] Stereo effect with two projectors and
> 	polarized lenses
> To: vtkusers at vtk.org
> Message-ID: <200407221553.36830.trinks at esc.cam.ac.uk>
> Content-Type: text/plain;  charset="iso-8859-1"
> 
> Hi Joerg,
> 
> 
> in TclTk I use for
> vtkRenderWindow renWin
> 
> 	renWin StereoCapableWindowOn
> 	renWin SetStereoTypeToCrystalEyes
> 	renWin StereoRenderOn
>         renWin Render
> 
> or the "Dresden" Mode:
> 
> 	renWin StereoCapableWindowOn
> 	renWin SetStereoTypeToDresden
> 	renWin StereoRenderOn
>         renWin Render
> 
> I hope this helps.
> Regards, 
> Immo
> 
> 
> 
> On Thursday 22 Jul 2004 15:41, trull78yaoo wrote:
> > Hello vtk User!
> >
> > I have two projectors with polarized lenses and polarized glasses, and want
> > to use it with VTK. My System: WinXP Nvidia GeForce FX 5600. I'm VTK
> > beginner and need help to solve this problem in C++. Must i change the
> > graphic card or WinXP settings? What function need my short example file?
> > Many thanks!
> >
> > Joerg Lubnau
> > -------------------------------------------------------------
> > #include "vtkConeSource.h"
> > #include "vtkPolyDataMapper.h"
> > #include "vtkRenderWindow.h"
> > #include "vtkRenderWindowInteractor.h"
> > #include "vtkCamera.h"
> > #include "vtkActor.h"
> > #include "vtkRenderer.h"
> > #include "vtkInteractorStyleTrackballCamera.h"
> >
> > int main( int argc, char *argv[] )
> > {
> >   vtkConeSource *cone = vtkConeSource::New();
> >   cone->SetHeight( 3.0 );
> >   cone->SetRadius( 1.0 );
> >   cone->SetResolution( 10 );
> >
> >   vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
> >   coneMapper->SetInput( cone->GetOutput() );
> >
> >   vtkActor *coneActor = vtkActor::New();
> >   coneActor->SetMapper( coneMapper );
> >
> >   vtkRenderer *ren1= vtkRenderer::New();
> >   ren1->AddActor( coneActor );
> >   ren1->SetBackground( 0.1, 0.2, 0.4 );
> >
> >   vtkRenderWindow *renWin = vtkRenderWindow::New();
> >   renWin->AddRenderer( ren1 );
> >   renWin->SetSize( 300, 300 );
> >
> >   vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
> >   iren->SetRenderWindow(renWin);
> >
> >   vtkInteractorStyleTrackballCamera *style =
> >     vtkInteractorStyleTrackballCamera::New();
> >   iren->SetInteractorStyle(style);
> >
> >   iren->Initialize();
> >   iren->Start();
> >
> >   cone->Delete();
> >   coneMapper->Delete();
> >   coneActor->Delete();
> >   ren1->Delete();
> >   renWin->Delete();
> >   iren->Delete();
> >   style->Delete();
> >
> >   return 0;
> > }
> > ------------------------------------------------------------------
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> > <http://public.kitware.com/cgi-bin/vtkfaq> Follow this link to
> > subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list