Well you have something like this transformations:
M = T1 * T2 * S * T3
You transform vertex with above transformations. Because projection is simple, with given window coordinate you want to know that position in object (untransformed) space, you need to untransform window coordinate to object space...
Vwindow = M * V
V = inverse(M) * Vwindow
inverse(T1 * T2 * S * T3) = inverse(T3) * inverse(T2) * inverse(S) * inverse(T1)
Because inverse of translation is just changing the sign, and inverse of scale is reciprocal
inverse(M) = (-T3) * (-T2) * (1 / S) * (-T1)
With this matrix you can transform window coordinate to object space (the image).
It's easy to build this matrix by yourself.
Bookmarks