Thank you so much for posting this. I had seen this a while ago and never got round to thinking it out in full, and now I have :). Those are not "cheap sunglasses": they are 3D glasses for use with 3D television screens and the like. This is a fantastic demonstration and I encourage anyone with a spare pair of these glasses at home to take them apart to play with the lenses. I can explain most of the qualitative behaviour but I cannot fully account for the colour changes in your first photographs.
First of all, these are 3D glasses for which the stereoscopical information is encoded in the polarization state of the images: it must be that, as there is no equipment to shutter them synchronously to the image. While there are other passive 3D viewer systems, their behaviour under rotations gives them away as polarization-encoded.
The way these viewers work is by having the left- and right-eye images on different polarizations, with corresponding polaroids for each eye. However, using horizontal and vertical polarizations (or any two orthogonal linear polarizations) does not work in practice, because tilting your head even slightly would lead to double vision. This is resolved using circular polarization, which is stable against rotations: if you rotate a spiral, it looks much the same.
To detect this circularly polarized light (CPL), the usual solution is to use optical elements known as quarter-wave plate, which turn circular into linear polarization and vice versa. More specifically, they have a "slow" axis and a "fast" axis, and they will convert right-handed CPL into a linear polarization along one diagonal, and left-handed CPL into the other diagonal. (For more details, see this WP article.) Let's start with the pictures:
Once you have your linearly polarized light, you simply tack on a diagonally oriented polaroid, and you've got yourself a circular polarizer. (In the picture above, if right-handed CPL goes into the QWP it will go into the opposite diagonal and will not be transmitted through the linear polarizer.)
So, let's take a look at these glasses, then. They have quarter-wave plates facing the screen and polaroids facing your eyes, so they go like this:
Note that they are mirror images of each other. (They must be like this as the light they are trying to catch are mirror copies.) I have labelled each half using your nomenclature, and I'll prove this as I go on. The solid and dashed lines on the QWPs are the slow and fast axes; the polaroids project light onto the dotted line. To fix conventions, let's say the waveplates turn right (left) CPL into the polarization allowed by 1B (2B); I'll call the former D, for diagonal, and the latter A, for antidiagonal.
OK. Let's have a look at the different ways of combining the two glasses. Let's start with the simplest.
(i) 1A 2A
In this situation the light encounters four optical elements in succession: a QWP, a polaroid, another QWP, and another polaroid. Let's track its polarization state as it goes through that series.
- The light entering the glasses is unpolarized. This means that the quarter-wave plate has no effect on it.
- The polarizer in 1B then projects it into D.
- The second QWP then turns this D light into left CPL.
- The second polarizer then reprojects it onto A.
Each projection loses one half of the intensity, which results in a global reduction of 1/4. This matches your top-left picture.
Let's now turn the second lens. Note the effect on the second QWP and polaroid.
The situation is much the same. Note that the second QWP has switched slow $\leftrightarrow$ axes, so that the chirality is inversed. The final amplitude is unchanged as both left and right CPL have the same projection on A.
- The light is initially unpolarized so the first quarter-wave plate has no effect.
- The polarizer in 1B then projects it into D.
- The second QWP then turns this D light into right CPL.
- The second polarizer then reprojects it onto A.
There are two projections so there is a global reduction of 1/4, which matches your top-right picture. (I'll talk about the colours at the end.)
(ii) 1B 2A
For both orientations, the final step involves projecting A or D light on a D resp. A polaroid, so the final amplitude is zero, which matches your second set of images. Thus, analogously to the above:
Note the effect of the two simultaneous, equally aligned quarter-wave plates. This is not-very-surprisingly known as a half-wave plate, and reflects linear polarization about its axes. Also, note that the 1B polaroid has changed orientation, as it has been turned in space.
- The initial polaroid projects the initial light into A.
- The first QWP makes it right CPL.
- The second QWP makes it linearly polarized along D.
- The second polarizer is along A and kills the signal.
For the other orientation, now,
- The initial polaroid projects the initial light into A.
- The first QWP makes it right CPL.
- The second QWP is now rotated so it turns the light back to A.
- The second polarizer is now along D and it kills the signal.
Another way to understand this is that the first lens, being backside-front, acts as a circular polarizer: it takes initially unpolarized light and it produces right CPL, which it was originally designed to select for. This is then passed on to the second lens, which is designed to select for the opposite handedness of CPL, so there is no transmission. If you turn the lenses relative to each other you are effectively trying to rotate the right CPL in the middle before it gets projected out by the left-CPL polarizer. However, rotating CPL has no effect on it (rotate a spiral and you'll get a shifted spiral), and this is why all orientations in this configuration have zero transmittance.
(iii) 1A 2B
I think I've got most everything covered so I'll go a bit more briskly.
- The first QWP does nothing to unpolarized light.
- The first polarizer projects along D.
- The second polarizer is also along D, so there is no effect.
- The final QWP's effect is irrelevant.
Thus the final effect is exactly the same as a single lens, at 1/2 of the intensity.
For the rotated one,
- The first QWP does nothing to unpolarized light.
- The first polaroid projects along D.
- The second polaroid is now along A, so it kills the signal.
This matches your third set of images.
OK, so that's a qualitative explanation for all the images you posted. This must also be able to account for the observations at intermediate orientations (though for (ii) that will probably be messy). Let me go quickly through your questions:
Two of the "colours" you identify are not actually that. They are just the gray that comes from two consecutive polarizers, and the black corresponding to no transmission. (Assuming perfect polarizers, of course; in the real world there will be some minor transmission.)
The other two colours, however, are quite interesting. They arise in situation (i), where a quarter-wave plate is sandwiched between polaroids. Here, however, without a more in-depth look at those quarter-wave plates, one can only guess. Circularly polarized light can be thought of as equal amounts of horizontally and vertically polarized light, temporally displaced by half a period. A QWP delays one of those components by that amount so that they fall in step and therefore make linearly polarized light along A or D.
However, doing that is tricky and depends on the frequency. The trick is to have different refraction indices for H and V polarized light, so they acquire different phases. This depends quite heavily on the light's frequency and therefore its colour, which means that the QWP's effect on different colours will be different. Hence the different colours in part (i).
The short answer to your second question is that the lenses are two-sided. One side has a waveplate and the other a polaroid. Thus turning them radically changes the situation.
And, finally: does polarization play a role in these lenses? Yes!