[cairo] API Shakeup wrapup: The plan going forward
Nathan Hurst
njh at hawthorn.csse.monash.edu.au
Fri Feb 25 20:14:12 PST 2005
On Fri, 25 Feb 2005, Bill Spitzak wrote:
> Nathan Hurst wrote:
>> 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.
You mean if you project them?
> I think I heard that this also allows Bezier to produce correct conic
> sections.
Yes, they're (basically) NURBs.
> 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.
Sure, but they aren't correct. Just like you can make a reasonable
perspective warp of a textured triangle using linear interpolation. My
point is that we should be careful about adding random 'niftyness' to
cairo, particularly if it involves compromises. If the user wants 3d
stuff, should they instead be looking at opengl?
njh
More information about the cairo
mailing list