Are there any examples of quadtrees being used in HTML5 Canvas? [closed]
Asked Answered
R

2

6

Quadtrees are used as an optimisation in games and elsewhere for spatial organisation of entities http://en.wikipedia.org/wiki/Quadtree.

Are there any examples of quadtrees being used for HTML5 Canvas?

Roseannaroseanne answered 3/8, 2011 at 11:10 Comment(0)
M
5

I think you should visit Mike Chambers.

Using Easel JS.

http://www.mikechambers.com/blog/2011/03/21/javascript-quadtree-implementation/

Mannos answered 24/8, 2011 at 13:41 Comment(0)
C
2

HTML5 canvas is merely a standard that doesn't define it's particular implementation. However I still doubt that canvas's will use quadtrees in their implementation. Quadtrees are mainly used for efficient collision detection and in general storing spatial data.

On the other hand, a canvas acts as a bitmap which is more naturally stored as a pixel array. There isn't any notion of "colliding" objects so each element is drawn independently of the previous ones.

Confounded answered 3/8, 2011 at 11:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.