How to create stereo anaglyphs with NVIZ
Step by step
This is a quick an dirty recipe to produce red-green anaglyphs on the fly in NVIZ.
- 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 !
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.