2D QuadTree Demo


demo here

I am new to QuadTree structures and watched the series from https://github.com/CodingTrain/QuadTree/tree/main.
Then made a threejs 2D version.

A lot could probably be changed and optimized but still fun.

7 Likes

Tried to add as many points as I could


new demo

1 Like

A collision model because i felt I should.


A model that has 30000 points. When points overlaps or collide, they are colored red.

Checking collisions for every point would normally be n^2 or 30000^30000 w/o some tree structure. I wanted to toggle the n^2 version in my animation loop but the FPS drop to around 1-2 FPS

1 Like

Sorry I keep updating this thread with similar versions. I will stop at this one :slight_smile:
Also, I may have made it a little too dramatic with the music ¯_(ツ)_/¯

thermodynamics demo, 20_000 points elastic collision model

2 Likes

Don’t be sorry, and don’t stop. Whenever you make some important improvement, we’d like to learn it here.

1 Like

Thanks and very much appreciate the threejs community!

1 Like