
Boris Borcic wrote:
Aaron Spike wrote:
I spent some time trying to write an extension to do perspective transforms a while back and I failed. The result of that experiment is in the Effects menu (labeled either "Summer's Night" or "Envelope"). The envelope effect is not a true perspective distortion. If you would be interested in helping me with the math (I've still got the code for my two or three other failed attempts around somewhere), maybe we could get something clunky worked out in python.
FWIW, here is the persp transform code in AGG
http://www.antigrain.com/__code/include/agg_trans_perspective.h.html
I've just had a look at "Summer's Night" code.
An issue you'll have with perspective transforms is that they don't generally commute with Bezier curves.
IOW, the perspective transform of a Bezier curve obtained from some controls points in NOT in general the same as the Bezier curve obtained from the perspective transforms of the initial control points.
The simplest way out of this problem is to flatten the paths before transformation.
hth, bb