This repository showcases three interactive graphical demonstrations built in Rust using the minifb window library.
An interactive and animated implementation of Chaikin’s curve smoothing algorithm.
A classic radar-style animation featuring a sweeping line and disappearing blips.
A smooth snake-like animation that follows the user's cursor in real-time.
Chaikin's algorithm iteratively smooths a polyline by subdividing line segments, producing a curve-like effect.
Features:
- Place control points with left mouse button
- Start animation with Enter
- Runs through 7 refinement steps
- Clear screen with C
- Drag points to move them
- Exit with Esc
A stylized radar simulation featuring:
Features:
- Rotating sweep line
- Random blips that fade over time
- Concentric range rings
- Exit with Esc
A fun snake-like follower that reacts to mouse movement.
Features:
- Smooth motion with physics-inspired spring behavior
- Segments follow each other with delay
- Exit with Esc
- Rust 1.50+
cargopackage manager
Clone this repository:
git clone https://github.com/aminehabchi/CHAIKIN.git
cd CHAIKINSteps:
- Users define a polyline by placing control points.
- Each iteration replaces every segment AB with two points:
- One at ¼ of the way from A to B
- One at ¾ of the way from A to B
- This is repeated for 7 iterations to smooth the shape.
- Uses trigonometric rotation to animate a sweeping line
- Blips appear randomly and fade
- Range rings offer visual scale
- Uses spring physics for smooth trailing
- Segments track the one before it
- Real-time interaction with mouse position
Contributions are welcome! Please feel free to open an issue or submit a pull request.