[cairo] 4x4 matrices in Cairo

Bill Spitzak spitzak at gmail.com
Thu Nov 14 13:16:02 PST 2013


I did not respond to the mailing list before, but some information got lost.

AD wrote:
> Hey guys,
> Is there a way to use 4x4 matrices in cairo?

You only need to support 3x3 matricies (because there is no Z for the 
source object, and the output Z is ignored). Cairo currently supports a 
2x3 matrix (affine transforms). Adding another column of (0,0,1) 
transforms this into the equivalent 3x3 matrix.

> Or alternatively a may to decompose a 4x4 matrix into several 3x3 matrices?

Some early 3D hardware could only do affine transforms. To texture-map a 
3D plane the rendering software had to cut it up into many thin 
triangles and apply the approximate affine transform to each of them. 
This is I guess possible in Cairo now, too.


More information about the cairo mailing list