Anaglyphs are 3D images made from stereographic image pairs and viewed with red-blue glasses. I have a destination class, MGgrWindow3D, for the object graphics system that will automatically produce anaglyphs from regular 3D object graphics hierarchies (but not 2D plots and images). I’ve seen anaglyphs which are able to maintain color information; I might try to update the code to allow for that, but right now everything ends up greyscale.

Example anaglyph produced by MGgrWindow3d

It’s easy to use MGgrWindow3D to make anaglyphs. Simply make the object graphics hierarchy and then use a MGgrWindow3D object as the destination:

owindow = obj_new('MGgrWindow3d')
owindow->draw, oview

The only special code for making an anaglyph in a widget program is the use of the classname keyword:

draw = widget_draw(tlb, xsize=400, ysize=400, graphics_level=2, $
                   /motion_events, /button_events, $
                   classname='MGgrWindow3D', uname='draw')

The CLASSNAME keyword was undocumented for a while, but has been officially documented since IDL 6.2.

Code for making anaglyphs:

MGgr3DConverter__define.pro (doc)

This code does the heavy lifting of producing left and right eye images and combining them.

MGgrWindow3D__define.pro (doc)

A drop-in replacement for IDLgrWindow that produces anaglyphs instead of regular output.

mg_3d_demo.pro (doc)

A demo of producing an anaglyph.

mg_3dwidget_demo.pro (doc)

A demo of producing an anaglyph in a draw widget.