Virtual Rubik’s Cube
2022-03-22

Virtual Rubik’s Cube

Interactive 3D simulator built to master the fundamentals of graphics programming and linear algebra.

The Inspiration

I’ve always been fascinated by the Rubik’s cube—not just solving it, but the math behind it. I wanted to build a simulator from scratch to force myself to truly understand 3D transformations, rotation matrices, and input raycasting.

Visual Experience

The project features a fully interactive 3D environment:

  • Free Cam: Mouse-controlled camera orbit to view the cube from any angle.
  • Animated Moves: Smooth interpolation for layer rotations, making the physics feel responsive.
  • Scramble & Solve: Built-in algorithms to randomize the state and restore it.

Key Takeaways

This “small” experiment was a crash course in Linear Algebra. I learned that Euler angles are prone to gimbal lock and that Quaternions, while intimidating, are the superior tool for 3D rotation interpolation.

Home Projects Resume