Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/topaz1008/voronoi-breakable
- Owner: topaz1008
- License: mit
- Created: 2023-01-13T13:39:28.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-19T07:47:32.000Z (10 months ago)
- Last Synced: 2024-10-10T01:30:39.776Z (3 months ago)
- Topics: delaunay-triangulation, javascript, matter-js, physics-simulation, simulation, voronoi-diagram
- Language: JavaScript
- Homepage:
- Size: 131 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.