Skip to content

Sujenphea/procedural-snake

Repository files navigation

WebGL Snake Animation

This project explores procedural snake motion using steering forces, endless curve generation, and instanced GPU rendering to create smooth, responsive movement in real time.

WebGL Snake Demo

Article on Codrops

Demo

Features

  • Procedural Motion: Steering-based direction blended in real time
  • Endless Curve Path: Incremental Bézier generation with sliding-window management
  • Stable Orientation: Parallel transport frames for twist-free surface alignment
  • GPU Instanced Rendering: Efficient body rendering driven entirely by shaders
  • Anatomical Shaping & Lighting: Non-uniform profile, subtle twist, and scale-like surface detail

Development

Start the development server with hot module replacement:

npm run dev

Open http://localhost:5173 in your browser.

Building for Production

Create an optimized production build:

npm run build

The built files will be in the dist/ directory. Preview the production build:

npm run preview

Credits

Misc

Follow Sujen: Twitter, GitHub, Linkedin

Follow Codrops: X, Facebook, Instagram, LinkedIn, GitHub

License

MIT

About

Procedural snake motion using steering forces, endless curves, and instanced GPU rendering.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors