A slightly more interesting demo of the phtree-c implementation.
An explanation of the PH-Tree can be found here.
This is a demonstration of a multimap PH-Tree. The entries in the tree represent 64x64 pixel cells, which store references to 2D points. Points are randomly generated, and placed in the proper cell on creation.
The PH-Tree implementation is in the external/phtree
folder.
You will need meson and ninja to build this project.
You will also need Raylib. Build Raylib and place libraylib.a
in external/raylib
(or whatever you have to do to make Raylib work).
Build
meson setup build
meson compile -C build
This will create the 'build
' directory.
The executable phtree
will be in the build
directory.
This was only tested on linux, so no idea if it works properly on anything else.
./build/phtree
Click or Click and drag to select points. Points inside of the selection box will turn red. Cells which the selection box queried will be lighter colored. Cells with no points in them do not exist and will remain black spaces inside of the selection box.
Press space to clear the selection box.
The code is released under MIT license.
Licenses of external code are provided in their respective folders.