tags:

views:

44

answers:

1
+3  A: 

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
It's quite possible that the deformed points could be in extremely unusual configurations, will it work for those cases? (such as the lower right point being very close to and/or on the other side of the upper left)
RCIX
Well, as long as you can represent it with scaling, shearing, rotation, it should be possible. Also there are perspective transformations which are a little harder to calculate but have pretty much the same underlying mathematics.
Joey