[cairo] Projective transformations

Carl Worth cworth at cworth.org
Tue Mar 20 13:49:11 PDT 2007


On Tue, 20 Mar 2007 16:04:17 +0100, "Christophe Dehais" wrote:
> Would it be difficult to make cairo_matrix hold a full 3x3 projective
> transformation matrix instead of an affine transformation (2x3 matrix)
> ? Such transformations (also called homography) handle perspective
> transformations and can simulate a kind of poor man's 3D.

It's been discussed before...

It seems like it would be quite appealing for doing image
transformation at least, (particularly since many of the graphics
systems underlying cairo have support for projective transformation).

One problematic aspect is that a projective transformation would
destroy the current algorithm implementing path stroking, (which
currently pre-computes a pen that is assumed to be stable throughout
the stroke). So there's at least one unsolved problem there.

A compromise position that has also been floated would be to allow a
projective matrix for pattern transformation and stick to an
affine-only matrix for the transformation matrix within the cairo
context.

That idea has been around for a long time, but no code has ever
appeared for it.

I imagine that in the meantime people that have really wanted 3D
effects have used 3D APIs for them, (often with cairo-rendered
textures: see http://cairographics.org/OpenGL).

I hope that helps explain where things stand on this issue,

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20070320/44e988ab/attachment.pgp


More information about the cairo mailing list