I'm writing a D3D game where the player's ship flies along and casts a shadow nearly directly underneath to give a clue to the player on the height of the ship. I'm attempting to make this a directional light by using an orthogonal projection for the projection matrix of the single light. As the ship moves forward, I update the location of the light so that the shadow remains the same relative to the ship's position. The problem is because I move the light, shadows for other objects move relative to the light, instead of also staying underneath their objects.
(I'm purposely darkening the shadows so that you can see them better.)
The blue ship is moving forward and the gray ship is stationary. Note where the shadow is for the gray ship.
The blue ship has moved forward. I've moved up the light so that the shadow stays under the blue ship, but I need the shadow under the other ship to stay under itself too. Instead, its shadow moved up since I moved up the light to chase the blue ship.
I feel like this should be easy to fix, but so far I can't figure it out. Thanks for your help.
Steve