[vtk-developers] New Stereo Mode

Thomas Hansen thomas.hansen at gmail.com
Mon Jun 20 12:18:35 EDT 2005


Hi David,

Thanks for the swift response.  I will take a closer look at how i can
use the setViewport method to maybe get the result i was looking for. 
But I'm not sure it'll do exactly what I want.

When the Stereo modes are turned on (RedBlue, Dresden and Interlaced)
the result frame is created by merging  two images (left and right) in
the vtkRenderWindow::StereoRenderComplete() method.  The images are
rendered already at this point and are accessed through the
GetPixelData method.

This happens for each renderer so if I were to set the setViewport() I
would actually  change the size of the renderer.  I still need the
renderer to fill the whole window.

The only problem is that the two images I use to build one bigger
image really only need to be half as wide.  Assuming a resolution of
800x600 on each screen i create a window 1600x600, but instead of
rendering two 800x600 pictures, I end up with two 1600x600 images of
which I have to cut 1/4 off each side and finally merge them.

Maybe i should  change the whole approach, and use two separate
renderes keeping track of the camera positions with respect to each
other instead.  It just seemed nice to facilitate the way that the
code already set up the two images.  It makes using the stereo code
allot easier too.

I hope I'm being somewhat clear...

Tahnks,
Thomas

On 6/20/05, David Cole <david.cole at kitware.com> wrote:
> vtkRenderer derives from vtkViewport. You can call
> vtkViewport::SetViewport(xmin, ymin, xmax, ymax) to make the renderer
> take up some fractional space of the render window... (Calling it with
> 0, 0, 0.5, 1.0 will make it take up the left half of the window, for
> example. 0.5, 0, 1.0, 1.0 would be the right half, etc.) Then you have
> to put another renderer into the other half of the window, or you'll end
> up with an undefined area of your window.
> 
> HTH,
> David



More information about the vtk-developers mailing list