Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gkjohnson/threejs-octree
A rough octree implementation to support frustum culling and raycasts in complex THREE.js scenes
https://github.com/gkjohnson/threejs-octree
graphics octree performance raycast three-js threejs
Last synced: 3 months ago
JSON representation
A rough octree implementation to support frustum culling and raycasts in complex THREE.js scenes
- Host: GitHub
- URL: https://github.com/gkjohnson/threejs-octree
- Owner: gkjohnson
- License: mit
- Created: 2018-07-14T17:58:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-27T05:44:26.000Z (over 1 year ago)
- Last Synced: 2024-10-05T12:11:48.381Z (4 months ago)
- Topics: graphics, octree, performance, raycast, three-js, threejs
- Language: JavaScript
- Homepage:
- Size: 2.21 MB
- Stars: 40
- Watchers: 5
- Forks: 11
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# 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?