Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/topaz1008/voronoi-breakable

Breakable rigid bodies using Voronoi diagrams
https://github.com/topaz1008/voronoi-breakable

delaunay-triangulation javascript matter-js physics-simulation simulation voronoi-diagram

Last synced: 3 months ago
JSON representation

Breakable rigid bodies using Voronoi diagrams

Awesome Lists containing this project

README

        

voronoi-breakable WIP
========================

Breakable rigid bodies simulation using Voronoi diagrams.

Using [matter.js](https://github.com/liabru/matter-js) physics engine and [Javascript-Voronoi](https://github.com/gorhill/Javascript-Voronoi) library by gorhill for calculating the voronoi diagram.

The voronoi diagram is calculated on-the-fly in real-time, and the number of sites is randomized using a random point spray.

Obviously it's not the most efficient way to do that but for the purpose of this demo it is fast enough.

NOTE: This demo is just a simple poc tech demo, might invest more in the future to make this code better written.
but for the time being this is just a research/poc/educational project.

## Demo
[Live demo](https://topaz1008.github.io/voronoi-breakable/); it will shoot 2 boxes towards each other on load, but you can click the mouse anywhere to shoot more.

You can also pause/unpause using the `P` key.