Note: I'm not quite sure whether this question properly belongs to the Mathematica or to the mathematics Stack Exchange. But because my question mainly concerns general mathematical principles rather than specific Mathematica issues, I've opted for the latter.)

For as long as I can remember, I've been fond of anaglyph pictures. An anaglyph is a stereoscopic image made by encoding each eye's image using filters of different (usually chromatically opposite) colors, typically red and cyan. (Wikipedia.) Anaglyphs are viewed using special eyeglasses with two differently colored lenses.

Nowadays I especially like anaglyphs depicting mathematical objects. That's why I was quite excited when I found a Mathematica notebook with which one can easily turn an ordinary Mathematica 3d image into an anaglyph. Here it is: Mathematica anaglyphs. After tinkering with it a bit, the notebook produces very satisfactory results.

The actual anaglyph-generating code is surprisingly simple. Basically, it takes a 3d scene and then creates the two color filtered images, using slightly different camera positions for each image. Both these positions lie on a circle of radius $5$ and are separated by a small angle $2\delta=1.4^\circ$. (As far as I know, the coordinate system that Mathematica uses is scaled with respect to the bounding box of the scene.)

Unfortunately, the code itself does not contain any comments on its inner workings. In particular, it doesn't account for a few seemingly arbitrary choices of parameters. My main question is: where does this angle $2\delta=1.4^\circ$ come from? Is it a constant? Or does it depend on certain other variables involved in creating the image (such as the radius $R$ of the circle on which the camera is moving). Also: is there a special reason for choosing $R=5$? And finally: is the method I described really the most efficient and accurate way of producing anaglyphs? Any answers and/or additional explanations of the mathematics of anaglyphs would be greatly appreciated.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.