[cairo] perspective rotation

Bob Jamison ishmalius at gmail.com
Tue Aug 12 14:30:49 PDT 2008


Since Cairo and other 2d things use affine transforms, you can't
get a perspective view the easy way. They are closed under
multiplication, meaning you can't combine affines to produce

But you CAN manually apply a perspective transform...
Instead of using primitive objects, you can use paths, whether closed
or open.  Write your own perspective matrix, and apply it to
each of the locations/control points in the paths individually.
This method is limited in what it can provide, but it works.

Stroke will not follow the scale of the "distance", but fills should 
look ok.

bob (ishmal @ inkscape.org)

More information about the cairo mailing list