Showcase »
Octree Example
A simple, single-threaded implementation of a loose octree
which is commonplace in computer graphics. In this example, octree is used for
collision detection.
Controls
mouse drag rotates the camera
Shift mouse drag pans the camera
mouse wheel zooms in/out
R resets the camera to its original transformation
O switches between a brute force and octree
collision detection
B shows/hides tree node bounding boxes
P toggles frame profiling to the console using
DebugTools::FrameProfiler
Space pauses/resumes particle simulation
Additionally, various options can be set via GET parameters:
spheres=N
— number of spheres to simulate (default: 2000)
sphere-radius=R
— sphere radius (default: 0.0333)
sphere-velocity=V
— sphere velocity (default: 0.05)
With the default setting, the octree collision detection is about twice as
fast than the brute force method. In order to better see the octree
visualization, append the following parameters to the URL
or click this link :
?spheres=20&sphere-radius=0.1&sphere-velocity=1.0