[orx-hash-grid] Tweak demo comments

This commit is contained in:
Abe Pazos
2025-10-01 20:43:31 +02:00
parent ec37b7a1e6
commit 2b56cd5502
3 changed files with 13 additions and 9 deletions

View File

@@ -5,13 +5,15 @@ import org.openrndr.extra.noise.shapes.uniform
import kotlin.random.Random
/**
* This demo sets up an interactive graphics application with a configurable
* display window and visualization logic. It uses a `HashGrid` to manage points
* in a 2D space and randomly generates points within the drawable area. These
* points are then inserted into the grid if they satisfy certain spatial conditions.
* This demo creates a `HashGrid` to manage points in a 2D space.
* Notice the desired cell size in the HashGrid constructor.
*
* On every animation frame, it attempts to insert 100 random points into the HashGrid.
* When a HashGrid cell is free, a point is inserted.
*
* The visual output includes:
* - Rectangles representing the bounds of the cells in the grid.
* - Circles representing the generated points.
* - Rectangles representing the bounds of the occupied cells in the grid.
* - Circles representing the generated random points.
*/
fun main() = application {
configure {
@@ -33,7 +35,6 @@ fun main() = application {
drawer.fill = null
drawer.stroke = ColorRGBa.WHITE
drawer.rectangles(hashGrid.cells().map { it.bounds }.toList())
drawer.fill = null
drawer.stroke = ColorRGBa.PINK
drawer.circles(hashGrid.points().map { it.first }.toList(), 36.0)
}