[cairo] An idea, cairo_transform_path?
cworth at east.isi.edu
Thu May 6 19:57:37 PDT 2004
On Fri, 7 May 2004 00:14:37 +0200, "Maarten Breddels" wrote:
> Some time ago I was using cairo_current_path to draw 3D text. When the
> first callback was made move_to I would call cairo_new_path, and do a 3D
> transformation for the rest of the points and creating a new path from
> these points. By looking at the cairo code I knew this would work, but
> it feels a bit like a hack.
Creating a new path during the callback is not a hack. The current_path
function is designed specifically so that this behavior is well-defined,
(it always operates on a copy of the path). The fact that you had to
look at the code is just that we haven't finished the documentation yet.
> Would it make sense to add
> cairo_transform_path? This would make transformations like 3D
> projections possible.
I don't think this call would make sense.
But what would be interesting is to expand the CTM to allow a
perspective transformation matrix rather than just an affine
matrix. This would give you what you want but would work much more
But that would have a non-trivial impact on most of the interesting
algorithms in cairo.
More information about the cairo