Here's the only relevant code in Chimera (in C++).
bool
StereoAnaglyph::setup(const Viewer *, int view) const
{
switch (view) {
case 0:
glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE);
break;
case 1:
glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_FALSE);
break;
}
return true;
}
For implementing a new ChimeraX camera mode you want to look at camera.py in ChimeraX
All OpenGL graphics is done from Python in ChimeraX (it was all in C++ in Chimera). You might start with a copy of the SplitStereoCamera class in that file. Your anaglyph camera mode would want to do the same thing, render two eye images, use the glColorMask() option to make one image red, the other cyan. The main difference is you want to draw the two on top of each other by adding instead of side-by-side. The additive blending OpenGL code you need is probably not too hard. If you get stuck I can advise.
Tom