Article View: comp.sys.next.programmer
Article #563Re: tracing a bezier curve
From: Greg Cockroft
Date: Tue, 07 Apr 1992 20:39
Date: Tue, 07 Apr 1992 20:39
56 lines
1994 bytes
1994 bytes
The parametric equation is x = x0*(1-t)^3 + x1*3*t*(1-t)^2 + x2*3*t^2*(1-t) + x3*t^3 Same thing for y. You can plot by just letting t go from 0 to 1 in some increment and draw lines at the (x,y) points. A more common plot is to recursively subdivide until the spline is close enough to just a line between (x0,y0) & (x3,y3). control points for half of split s0 = X0 s1 = .5*(x0 + x1) s2 = .25*(x0 + 2*x1 + x2) s3 = .125*(x0 + 3*x1 + 3*x2 + x3) second half of split t0 = .125*(x0 + 3*x1 + 3*x2 + x3) t1 = .25*(x1 + 2*x2 + x3) t2 = .5*(x2+x3) t3 = x3 A good book is Splines for use in computer graphics & gemoetric modeling Bartels,Beatty,Barsky IBSN 0-934613-27-3 -greg. Brian C. Hobbs writes > > If I constrained a bezier curve to conform to a function (as in > "every x value has one and only one y value"), and plotted it out via a > curveto operator, is there any way that I could find out what the y value > for a point along the curve would be for any x value? Either the relevant > equations for a Bezier curve or some ps code to trace it would be very > helpful. > > This would sort of be like the functionality of the gamma curve > manipulator in Scene. > > Thanks. > > > -- > Brian C. Hobbs | "I am Number Two." > Chromagrafx Imaging Systems | "Who is Number One?" > brian@chromagrafx.com | "You are, Number Six." -- Greg Cockroft greg@agog.com Agog, Inc. (517) 627-2186 fax 2673 13780 North River Highway
Technical Details
Message-ID:
<1992Apr7.203952.300@agog.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!heifetz!agog!gregReferences:
<1992Apr6.201926.4118@chromagrafx.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!heifetz!agog!greg From: greg@agog.com (Greg Cockroft) Newsgroups: comp.sys.next.programmer Subject: Re: tracing a bezier curve Message-ID: <1992Apr7.203952.300@agog.com> Date: 7 Apr 92 20:39:52 GMT Article-I.D.: agog.1992Apr7.203952.300 References: <1992Apr6.201926.4118@chromagrafx.com> Sender: greg@agog.com (Greg Cockroft) Reply-To: greg@agog.com Organization: Agog, Inc. Lines: 56