Stereo anaglyphs

From GRASS-Wiki
Revision as of 14:15, 4 March 2008 by Peter.loewe (talk | contribs) (Step by step)

Jump to: navigation, search

How to create stereo anaglyphs with NVIZ

Example: http://grass.osgeo.org/screenshots/images/mars1ana_small.jpg

Step by step

This is a quick and dirty recipe to produce red-green anaglyphs on the fly in NVIZ.

Requirements:

  • You will need a pair of red-green glasses to properly watch the anaglyph image.
  • Both ppmtorgb3 and rgb3toppm are required.

Note: It shouldn't be too difficult to add the core functionality as a script into NVIZ. Then we could also have animated anaglyph movies, creature-of-the-black-lagoon-style !

Recipe:

Please remember that anaglyps trade color information for depth. Consider it as a black & white image, fancy surface colors will not show.

1) Load the DEM of choice into NVIZ and find a convenient viewing angle.

2) Assuming your position is not tilted, move the puck a tiny bit to the left and create a PPM image (for example "left.ppm").

3) Shift a bit to the right and repeat. Create another ppm image there: "right.ppm"

[It takes practice to judge the necessary distance between the viewing angles. If the completed product doesn't exactly "jump out of the screen", try again with a larger distance. Otherwise, if the final product gives you a splitting headache when looking at it, opt for a reduced distance (or something nicer to watch).]

4) ppmtorgb3 left.ppm -> Creates from left.ppm the files left.red, left.green, left.blue

5) ppmtorgb3 right.ppm -> Creates from right.ppm the files right.red, right.green, right.blue

6) rgb3toppm left.red right.green right.blue > myfirstanaglyph.ppm

7) Put on the red-green glasses and watch myfirstanagly.ppm with your favourite image viewer.


Voila !