- check this video https://youtu.be/aVwxzDHniEw?si=pAiWg5cSHg_x4e_W
This project demonstrates the implementation of Bezier curves in C using the raylib graphics library. Bezier curves are widely used in computer graphics to model smooth curves that can be scaled indefinitely.
Bezier curves are a fundamental tool in computer graphics and animation for creating smooth and scalable curves. This project showcases how to create and manipulate Bezier curves using the C programming language and the raylib graphics library.
A Bezier curve is defined by a set of control points. The most common types are:
- Linear Bezier Curve (defined by 2 points)
- Quadratic Bezier Curve (defined by 3 points)
- Cubic Bezier Curve (defined by 4 points)
The mathematical formula for a cubic Bezier curve is:
where
- Implementation of cubic Bezier curves.
- Interactive visualization using raylib.
- Adjustable control points to see real-time updates of the curve.
Bezier curve showing smooth transitions between points.
click F1 to swtich between the curves.
with the mouse wheel u can ajust the sample steps.
- C compiler (gcc, clang)
- raylib library (it is included in the repository)
- linux (or WSL on Windows) , for other platforms you can use the raylib library and compile the code with the raylib library (https://www.raylib.com/)
- Clone the repository:
git clone https://github.com/edaywalid/Bezier cd Bezier
- Run the program:
chmod +x build.sh ./build.sh