Skip to content

aminehabchi/CHAIKIN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Graphics Demonstrations with minifb

This repository showcases three interactive graphical demonstrations built in Rust using the minifb window library.

Included Demos

1. Chaikin's Curve Algorithm Animation

An interactive and animated implementation of Chaikin’s curve smoothing algorithm.

2. Radar Animation

A classic radar-style animation featuring a sweeping line and disappearing blips.

3. Snake Cursor Follower

A smooth snake-like animation that follows the user's cursor in real-time.


Demonstrations

Chaikin's Curve Algorithm

Chaikin's Curve Animation

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

Radar Animation

Radar Animation

A stylized radar simulation featuring:

Features:

  • Rotating sweep line
  • Random blips that fade over time
  • Concentric range rings
  • Exit with Esc

Snake Cursor Follower

Snake Cursor Follower

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

Requirements

  • Rust 1.50+
  • cargo package manager

Installation

Clone this repository:

git clone https://github.com/aminehabchi/CHAIKIN.git
cd CHAIKIN

Implementation Details

Chaikin's Algorithm

Steps:

  1. Users define a polyline by placing control points.
  2. 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
  3. This is repeated for 7 iterations to smooth the shape.

Radar Animation

  • Uses trigonometric rotation to animate a sweeping line
  • Blips appear randomly and fade
  • Range rings offer visual scale

Snake Cursor Follower

  • Uses spring physics for smooth trailing
  • Segments track the one before it
  • Real-time interaction with mouse position

Contributing

Contributions are welcome! Please feel free to open an issue or submit a pull request.

About

three interactive graphical demonstrations built in Rust using the minifb window library.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages