Figure 1: The perspective transform matrix
Cos(a) 0 0 -rSin(a) 0 1 0 0 Sin(a) 0 0 rCos(a) 0 0 0 1