Skip to content
Projects

gkjohnson/threejs-octree has 45 GitHub stars and 11 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-15 01:29 UTC. Last push 2023-10-27.

How these counts are measured

Measured star growth

in 24h
0
in 7 days
Collecting history
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

About

A rough octree implementation to support frustum culling and raycasts in complex THREE.js scenes

Creative & Media

README.md

Original

threejs-octree

A rough octree implementation to support frustum culling and raycasts in complex THREE.js scenes.

NOTE: Code is generally unmatained and unfinished.

TODO

  • Max depth is needed in case there are a bunch of objects right on top of eachother
  • Consider adding an optimization using SAH and constricting the bounding boxes a a bit more
  • Provide an option for iteratively flushing all pending inserts because this can be expensive on cast operations
  • Raycasts can be a bit slow when the tree is large. This seems due to a lot of objects not being pushed down into leaves that are straddling an octant boundary.
  • Add, update, and remove operations are all delayed at the moment as well as the objects being pushed down into the tree -- we shouldn't need both (or either? Remove them?)
  • Optimize object removal.
  • Use something like an SAH algorithm to decide when to split.
  • Shrink the bounds to a size that optimially constrains the child objects?