[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/vr/ - Retro Games

Search:


View post   

>> No.3164445 [View]
File: 2 KB, 293x298, PTriangle.gif [View same] [iqdb] [saucenao] [google]
3164445

>>3164293
So here are bezier curves animated for playing around with them:
http://www.jasondavies.com/animated-bezier/
Each successive higher tier of bezier has more offset points between end points but they overall influence the curve less and less.

Actual equations here:
http://en.wikipedia.org/wiki/B%C3%A9zier_curve

The un-simplified versions of the equations can seem more complex than they really are.

For the coefficients of the polynomials for an nth degree bezier curve, all you need is a pascal's triangle (pic related.)

You have start point and end point, say p_0 and p_1. The rate of change from start to end is t, and t must have a value between 0 and 1.

So a second degree bezier curve (just a straight line) is

(1 - t) * p_0 + t * p_1

And it's just the difference between the start and the end point progressed from 0 to 1. At 0 the value is p_0, and at 1 the value is p_n. The coefficients for that polynomial are 1 and 1, or the second level of the triangle.

In larger degrees all that's done is the addition of more control points, which are points the curve will approach but never reach.

To get the equations for an nth level curve you can either simplify the corresponding formula or there is a trick you can do instead, involving the triangle. The trick is as follows:

(continued in next post)

Navigation
View posts[+24][+48][+96]