🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
2 messages
2 total messages Started by Brian C. Hobbs Mon, 06 Apr 1992 20:19
tracing a bezier curve
#555
Author: Brian C. Hobbs
Date: Mon, 06 Apr 1992 20:19
22 lines
1115 bytes
	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."
-- 
Brian C. Hobbs				|	"I am Number Two."
Chromagrafx Imaging Systems	|	"Who is Number One?"
brian@chromagrafx.com		|	"You are, Number Six."
Re: tracing a bezier curve
#563
Author: Greg Cockroft
Date: Tue, 07 Apr 1992 20:39
56 lines
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads