extension joomla, template joomla,banner extension joomla,jomla slider,slider joomla
Bezier Curves and Bezier Surfaces generation with C/C++ in Code::Blocks
Brief Theory of Bezier Curve
In order to draw curvy surface we implement Bezier curve algorithm. In drawing Bezier we first define n+1 control point pk = (xk, yk, zk) with k varying from 0 to n. And the coordinate points are blended to produce following position vectors that define the path of an approximation Bezier polynomial function between p0 and pn.

Beizer Polynomial Function
The Bezier blending functions BEZk,n(u) are the Bernstein polynomials: BEZk,n(u)=C(n,k)uk(1-u)n-k
Where the C(n, k) are binomial coefficients.
Equivalently, we can define Bezier blending functions with the recursion calculation.
BEZk,n (u) = (1-u) BEZk,n-1(u)+u BEZk-1,n-1(u), n>k?1
With BEZk,k = uk , and BEZ0,k = (1-u)k.


C Source Code

Note: to run this code in your machine with Code::blocks IDE, add a link
library libgdi32.a (it is usually inside MinGWlib )  in linker setting. 
Output

Beizer Surface



Related Article



destination source:https://www.programming-techniques.com/?p=99