[vtkusers] 3D monitors

Kishore Mosaliganti kishoreraom at gmail.com
Thu May 17 10:59:09 EDT 2012


Hi Hal,

Thanks for the response. I tried out the code and of the many options
available in vtkRenderWindow, only the
renderWindow->SetStereoTypeToRedBlue() appears to work.

When I set renderWindow->SetStereoTypeToCrystalEyes(), it shows a normal
cube.

I have a compatible nVidia GEFORCE 3D vision system with which I can see
demos of Cystal Eye images. Any ideas what might be happening

Kishore

On Wed, May 16, 2012 at 5:32 PM, Hal Canary <hal at cs.unc.edu> wrote:

> On 05/16/2012 05:10 PM, Hal Canary wrote:
>
>> On 05/16/2012 02:17 PM, Kishore Mosaliganti wrote:
>> > Is there a "Hello World" program for stereo rendering available
>> > somewhere? Do you guys mind sharing this code if you have it.
>>
> >
>
>> Here it is in Python:  [...]
>>
>
>
> And I've just translated it into C++, just to see if that worked too.
>
> #include "vtkActor.h"
> #include "vtkCamera.h"
> #include "vtkCubeSource.h"
> #include "vtkRenderWindow.h"
> #include "vtkRenderWindowInteractor.h"
> #include "vtkRenderer.h"
> #include "vtkDataSetMapper.h"
> #include "vtkInteractorStyle.h"
> #include "**vtkInteractorStyleTrackballCam**era.h"
> int main(int argc, char** argv) {
>  vtkCamera * camera = vtkCamera::New();
>  camera->SetPosition(2.5, 2.0, 1.0);
>  camera->SetFocalPoint(0.0, 0.0, 0.0);
>  camera->SetViewUp(0.0, 1.0, 0.0);
>  camera->SetViewAngle(30);
>  vtkRenderer * renderer = vtkRenderer::New();
>  renderer->SetActiveCamera(**camera);
>  vtkCubeSource * cubeSource = vtkCubeSource::New();
>  vtkDataSetMapper * dataSetMapper = vtkDataSetMapper::New();
>  dataSetMapper->**SetInputConnection(cubeSource-**>GetOutputPort());
>  vtkActor * actor = vtkActor::New();
>  actor->SetMapper(**dataSetMapper);
>  renderer->AddActor(actor);
>  vtkRenderWindow * renderWindow = vtkRenderWindow::New();
>  renderWindow->FullScreenOn();
>  renderWindow->**StereoCapableWindowOn();
>  renderWindow->**SetStereoTypeToCrystalEyes();
>  renderWindow->StereoRenderOn()**;
>  renderWindow->AddRenderer(**renderer);
>  vtkRenderWindowInteractor * renderWindowInteractor
>    = vtkRenderWindowInteractor::**New();
>  renderWindowInteractor->**SetRenderWindow(renderWindow);
>  vtkInteractorStyle * interactorStyle
>    = vtkInteractorStyleTrackballCam**era::New();
>  renderWindowInteractor->**SetInteractorStyle(**interactorStyle);
>  renderWindowInteractor->**Initialize();
>  renderWindow->Render();
>  renderWindowInteractor->Start(**);
>  return 0;
> }
>
>
> --
> Hal Canary
>
> ______________________________**_________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/**
> opensource/opensource.html<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 <http://www.vtk.org/Wiki/VTK_FAQ>
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/**listinfo/vtkusers<http://www.vtk.org/mailman/listinfo/vtkusers>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120517/d213e2d5/attachment.htm>


More information about the vtkusers mailing list