Render 3D B-splines in C++ using Qt, OpenGL, and Eigen.
B-splines are parametric curves composed of multiple Bézier segments, where each segment's control points satisfy specific continuity conditions. This project uses cubic Bézier curves to interpolate between knots. For each pair of knots, a cubic Bézier curve is generated, and these are joined to form the final B-spline curve.
The core algorithm is based on this reference (originally for 2D B-splines, but easily adapted to 3D).
- Interactive 3D B-spline curve rendering
- Modern C++ codebase
- Utilizes Qt for GUI, OpenGL for rendering, and Eigen for linear algebra
-
Install dependencies:
- CMake 3.25.1+
- Visual Studio 2022 with MSVC C++ v143 compiler
- Qt 6.7.3 MSVC2022 64bit
-
Set environment variable:
Qt6_DIR
toC:\Qt\6.7.3\msvc2022_64
-
Clone the repository:
git clone https://github.com/berkbavas/BSplineRenderer.git
-
Create and enter build directory:
mkdir Build cd Build
-
Generate build files with CMake:
cmake ..
-
Open the solution in Visual Studio:
- Open
BSplineRenderer.sln
in Visual Studio 2022
- Open
-
Build the project:
- Build and run.
BSplineRenderer.mp4
For more details on the mathematics of B-splines, see the UCLA handout.
This project is licensed under the MIT License.