[cairo] perspective rotation

dargwin at gmx.net dargwin at gmx.net
Tue Aug 12 08:49:47 PDT 2008


Hello list,

I'm trying to do a perspective rotation around the x-axis with an image
surface. The result should look like this:

 +
 |  +
 |    +
 |    |
 |    |
 |    |
 |    +
 |  +
 +

But I'm really confused about the maxtrix to use for the transformation.
The closest result I got was this (python) code (following some code
found in this blog
http://kapo-cpp.blogspot.com/2008/01/perspective-effect-using-cairo.html)

matrix = cairo.Matrix(0.7, 0.25, 0.0, 1.0, 0.0, 0.0)
ctx.transform(matrix)

Is there any chance to do this with plain cairo? Unfortunately stuff
like OpenGL or clutter is not an option.

Thanks in advance


More information about the cairo mailing list