Transforming the 3D model affects the shadow map

Based on this article I have implemented the shadow map. everything seems to be OK. but when I transform the 3D model using the translation/rotation/scaling, the shadow becomes distorted.Also when I move the camera around the world, the shadow of the transformed objects flickers. I don’t know why the model matrix and moving the camera affects the shadow?

Sounds as if you have not truely decoupled your scene camera from the light’s camera. Perhaps your mistake is in calculating the inverse camera matrix.

Thanks, my problem solved :slight_smile:

Care to share with the community?