[vtkusers] Rendering a photograph in stereo
John Biddiscombe
biddisco at cscs.ch
Wed Apr 25 03:11:24 EDT 2007
Jacob
There are several ways to do what you want, but this is what I'd start
with...
have a look at vtkRenderWindow::DoStereoRender(), you can see that what
happens is first the renderers are traversed using the left eye, then
they are traversed with the right eye if stereo is on.
Option 1 would be to modify the vtkRenderWindow code to maintain a list
of left eye renderers and right eye renderers then only render each list
in each pass. You could then have your image actors added to left and
right renderers and it'd do what you want.
Add a new functions to vtkRenderWindow
AddLeftRenderer
AddRightRenderer
These will both call AddRenderer internally so that all the existing
code (which checks renderers for stuff) works as before. BUT in
addition, add two new lists for left eye renderers and right eye renderers.
vtkRendererCollection *LeftRenderers;
vtkRendererCollection *RightRenderers;
and add the renderers in there too when you call AddLeft AddRight
The reason for this is simply because you want to break as little
existing code as possible.
Now change the DoStereoRenderer method to call the left and right lists
during traversal but leave everythig else the same! It should work.
There may be a few other things you need to tweak.
Make sure anything you change is not overridden by vtkOpenGLXXX classes
which replace the functionality.
I've written this from the top of my head so there will be mistakes, but
it may help you get started.
JB
> I have a rather simple question that I have not been able to find a
> solution to, so I am hoping someone here can help. A bit about the
> problem... I have two photographs of a physical scene taken with two
> digital cameras from a left and right eye perspective (call them
> left.png and right.png). I also have experimental data (in the form
> of cone plots) that I want overlay onto these photos. Finally, I want
> to be able to view the scene (photos and overlaid data) in stereo mode
> using Crystal Eyes.
>
> Rendering the experimental data in stereo using cone plots is
> trivial. Also, doing an overlay of these data with an image from only
> one eye is fairly trivial, but I have not found a way to implement a
> stereo image. My question is... given a left and right eye
> photograph, how do I render the photographs in stereo? It seems like
> this should be possible in vtk, but I am at a loss, please help.
>
>
>
> Jacob Klos
>
> NASA Langley Research Center
> Structural Acoustics Branch
> Hampton, VA 23681-2199
>
> _______________________________________________
> This is the private VTK discussion list. Please keep messages
> on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
--
John Biddiscombe, email:biddisco @ cscs.ch
http://www.cscs.ch/about/BJohn.php
CSCS, Swiss National Supercomputing Centre | Tel: +41 (91) 610.82.07
Via Cantonale, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82
More information about the vtkusers
mailing list