[vtkusers] stereoskopic view with two projectors
trull78yaoo
trull78yaoo at yahoo.de
Fri Oct 22 03:25:16 EDT 2004
Hi all,
now somebody how can i test the stereoscopic view without vtk.
Because i have no stereoscopic effect with my
nvidia quadro fx500 in vtk. Can somebody help me?
Which settinge need Windows, graphic card or vtk?
My settings for graphic card: display mode is Clone,
enable stereo in OpenGL and the stereo display mode
is set to nView Clone.
Here my code:
#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( 1000 );
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->StereoCapableWindowOn();
renWin->SetStereoTypeToCrystalEyes();
// renWin->SetStereoTypeToDresden();
renWin->StereoRenderOn();
renWin->SetFullScreen(1);
renWin->AddRenderer( ren1 );
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;
}
Thank Jörg
More information about the vtkusers
mailing list