#### Archived

This topic is now archived and is closed to further replies.

# Following a Bezier Curve

This topic is 5232 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''m trying to implement some code to follow a bezier curve. I can draw the thing with no problem, with the glEvalCoord() function, but I can''t grab the coordinates to translate too. Anyone know the best way to do this or can point me in the right direction? I''ve tried to find a tutorial or something on it, but with no luck. Thanks

##### Share on other sites
The basic is this:

Give 3 points that make up the curve (p0, p1, p2) and a parameter t which varies from 0 to 1 (0 being the start of the curve, 1 being the end) any point on the curve can be calculated like so:

P(t) = ((1 - t)^2)*p0 + 2*(1-t)*t*p1 + t^2*p2

note: x^2 = x squared, not x xor 2

Here is an article on rendering bezier surfaces. Before getting to surfaces they talk about bezier curves which should help you out.

Clicky

You will need a gamasutra registration (free)

[edited by - terminate on March 23, 2004 6:40:51 PM]

1. 1
Rutin
24
2. 2
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 19
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631760
• Total Posts
3002176
×