This three-dimensional cube creates an ambiguous figure because it can be perceived in two ways: one is the actual physical cube; the other—the “rotating” cube—is an illusion.
If you were successful in perceiving the illusion, the bottom back corner of the cube seemed closer to you than the top front corner. This happens because closing one eye hinders your depth perception, making it easy for your brain to ignore the cues provided by the places where the straws cross. Normally, your two-eyed stereovision gives you enough information to interpret the cube correctly, which is why the illusion disappears when you open your other eye.
Why does the reversed cube appear to rotate as you change your viewing position? Try this: Close one eye, hold one of your index fingers at arm’s length, and line it up with some faraway reference point, such as a picture on a distant wall. Move your head to the right and notice that your finger appears to move to the left relative to the distant object; move your head to the left, and your finger seems to move to the right. Relative to the distant object, your finger (which is the closer object), moves in a direction opposite to that of your head.
When you see the cube in its “rotating mode” and you move your head to one side, your brain expects the parts of the cube closest to you to move to the other side. But the parts of the cube that your brain perceives as being closest are actually the parts that are more distant—so they move to the right instead. Trying to make sense of the situation (as it always does), your brain interprets the visual input as best it can: It “sees” the object rotating to follow your gaze.
Visual illusions are fun to play with, but they are also the subject of serious study by neuroscientists. The “mistakes” our brains make provide insights about our process of perception.