[cairo] 4x4 matrices in Cairo

James Cloos cloos at jhcloos.com
Thu Nov 14 13:49:19 PST 2013

AD>> Is there a way to use 4x4 matrices in cairo?

US> No. Cairo ... projective transformations ...

A 4x4 matrix implies 3D.

Perspective transforms for 2D require arbitrary 3x3 matrices and [x,y,z]
vectors, as opposed to [ [a,b,0], [c,d,0], [dx,dy,1] ] 3x3 matrices and
[x,y,1] vectors.  The also, of course, require rational splines rather
than polynomial.

(Some authors of course put the dx,dy where I put the 0s, and the 0s
where I put the dx and dy, depending on whether they prefer appending
or prepending the matrix to the vector.)

I always thought that support for rational splines would be a good point
to increment the major version.

James Cloos <cloos at jhcloos.com>         OpenPGP: 1024D/ED7DAEA6

More information about the cairo mailing list