jsBVH

A Bounding Volume Hierarchy Library for Javascript

by Jon-Carlos Rivera

Released under an MIT license

This page contains examples of my jsBVH Library (jsbvh.js) for Javascript. The library is an open-source, high performance, and non-recursive implementation of a multidimensional Bounding Volume Hierarchy data structure.

To contribute to, watch, or fork the jsBVH Library, see the project on GitHub at http://github.com/imbcmdth/jsBVH.

For API documentation, head over to jsBVH's Wiki at Github.

NEW Tests:

Javascript RayTracer!!

Uses jsBVH to accelerate the ray tracing of massive scenes!

Ray Playground 2D

A simple interactive example of the BVH. Shows an interactive Ray-BVH tests. Great for understanding BVH as used in ray tracing.

Super-Hardcore Example in 3D

ONLY run on Opera, Chrome, Safari, or Firefox 3.6 nightlies!
This test generates 20k dense non-overlapping rectangles of various size and color.

Old Tests:

Simple Unit Tests

Preliminary unit testing examples.

Benchmark

Inserts 10k objects. Performs some searches. Inserts another 10k objects. Performs some searches. Deletes and reinserts some objects. Performs some final searches.

Benchmark in 3D

Same benchmark as above but inserting and searching through a 3-dimensional volume instead of a 2-dimensional case.

Super-Hardcore Example

ONLY run on Opera, Chrome, Safari, or Firefox 3.6 nightlies!
This test generates 20k dense non-overlapping rectangles of various size and color.