Spline Curve Editor

C++

For this project, I created a 2D spline curve editor in C++! Created as a project for my CIS 5620 - Computer Animation class at UPenn.

Features include:

  • Placing anchor points with the mouse

  • Selecting between linear curves (C0), Bezier curves (C1), or Hermite curves (C2)

    • There are 3 implementations of Bezier curves: deCasteljao, matrix method, and berstein polynomial. Each is visually identical, but is coded using a different strategy.

  • Move and drag anchor points and control points

Splines can be used to make smooth lines like shown above, but can also be used to drive smooth animation!

Here you can see a comparison of Euler rotations and quaternion rotations! The Euler version is on the left, while the quaternion version is on the right. See how the quaternion version interpolates smoothly between poses, while the Euler version doesn’t follow the shortest path. This a major flaw of Euler rotation!

For more info on Euler vs quaternion rotation, check out this retro video here! It discusses gimbal lock and the importance of order of rotation of Euler angles.

Quaternions and Euler angles are fundamental to rotations in 3D, so it was great to learn the ins and outs of them during this project.

As a bonus, here’s a silly drawing I made using Hermite splines. I deem him β€œHermite Simpson” 🍩

Previous
Previous

GLSL Shaders

Next
Next

Scene Graph