You might want to read up on Affine transformations. There isn't much magic going on here, just a little translation and shearing. This is all done just with a matrix multiplication for the coordinate pairs (in homogenous coordinates), so it's very easy to do. But can be a little hard to understand :-)
Joey
2009-10-25 10:14:24