I have a sphere rendered to texture. I have an offset in screen coordinates (dx, dy), and I want to move the texture so that it still maps on the sphere. How can I calculate the transformation and transform the texture correctly?
My current idea is to render sphere, project each position to screen space, apply inverse offset and calculate position from which to sample pixel from source texture.
However, I don't know how to calculate the position from which to sample.
Simplified example with (0, dy) movement offset.
![](https://uploads.gamedev.net/forums/monthly_2022_12/daffa2fc579d42819c9d9807a3c75623.obrazek.png)
The sphere is at (0,0,0) rendered with ortho-camera put at (0, 0, offset).