[cairo] 4x4 matrices in Cairo

Tavmjong Bah tavmjong at free.fr
Fri Nov 15 08:05:59 PST 2013


On Fri, 2013-11-15 at 08:36 -0500, James Cloos wrote:
> >>>>> "BS" == Bill Spitzak <spitzak at gmail.com> writes:
> 
> JC>> Perspective transforms for 2D require arbitrary 3x3 matrices and [x,y,z]
> JC>> vectors
> 
> BS> Actually the 3x3 matrix can only handle [x,y,1] vectors. The last
> BS> number is the W, not the Z. The Z is effectively zero.
> 
> Yes, of course.  Poor copy editing. :(  I meant to write [x,y,w].
> 
> BS> I still think Cairo only needs to support 3x3 matrix though.
> 
> Indeed.  I tried to be explicit for the archives, but the intended thesis
> was exactly that.

It would be good if Cairo supported 2d perspective transforms. It would
even be better if Cairo could support 3d transforms as described by the
CSS Transforms specification (which uses a 4x4 matrix).[1] This
specification will be applicable to SVG so support in Cairo would
greatly benefit Inkscape. Support for 3d perspective transforms in SVG
is starting to make its way into browsers.[2]

Tav

[1] http://www.w3.org/TR/css3-transforms/
[2] Example, open in recent Firefox:
http://tavmjong.free.fr/SVG/SVGOpen2013/ARTISTS_2013/ball.svg





More information about the cairo mailing list