[cairo] API Shakeup wrapup: The plan going forward

Bill Spitzak spitzak at d2.com
Fri Feb 25 18:58:44 PST 2005


Nathan Hurst wrote:
> On Fri, 25 Feb 2005, David Reveman wrote:
> 
>> Perspective Transformations -
>> Maybe we don't want this in gstate but I think we should leave the door
>> open for perspective transformations of patterns. If we just make sure
>> that cairo_matrix_t is 3x3 when exposing it to the API as planned. hmm,
>> maybe cairo_concat_matrix should be named cairo_affine_transform.
> 
> 
> The problem with perspective is that beziers are not closed under 
> perspective transforms, so you have to decide how closely you want to 
> approximate the transform.  Does this belong in cairo, or rather in a 
> separate lib?

Bezier's are in fact correctly calculated if you do them in affine space 
  by interpolating the x,y,w values of the 3d projected control points. 
The resulting point on the screen is x/w, y/w.

I think I heard that this also allows Bezier to produce correct conic 
sections.

Even ignoring that, I certainly have made quite nice looking 3D 
"projections" in PostScript by projecting the bezier control points and 
then having it interpolate the resulting points in 2d.



More information about the cairo mailing list