I have a problem with shadowmapping in my shaders.  The occluder appears to be casting a shadow correctly on other objects, but not correctly on itself.  The effect is difficult to describe, but it looks sort of like the shadowmap is rotating twice as fast as the object rotates and is flipped (occluded not shadowed and vice-versa). 

The following example program displays the effect: geometrian.com/shadowmapping%20problem.zip.  The occluder is a spaceship from turbosquid.com rendered with VBOs (thanks!) and the floor is a single quad with a brick texture applied.  As you can see, the shadow on the floor looks correct (see below), but the shadow on the spaceship is not.  Try rotating the camera and the spaceship (left or right click + drag respectively). 

My guess is that the texture matrix is not being set up correctly.  The floor may look fine, but the floor is 2D, so the "flipped" effect mentioned earlier has no real effect.  Also, when the floor is rotated, the shadow rotates with it, so the rotation problem is still there too.  The spaceship shows these problems quite obviously. 

I think I should be able to fix the "flipped" problem in the shader, but what do I do about the shadow rotation problem?

Thanks a ton,