[orx-noise] Add hash functions

This commit is contained in:
Edwin Jakobs
2024-10-20 14:14:50 +02:00
parent 6e1e161726
commit fba1e5b61a
23 changed files with 473 additions and 63 deletions

View File

@@ -1,8 +1,7 @@
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extra.noise.uniform
import org.openrndr.extra.noise.shapes.hash
import org.openrndr.shape.Triangle
import kotlin.random.Random
/**
* Demonstrate the generation of uniformly distributed points inside a list of triangles
@@ -17,8 +16,10 @@ fun main() {
program {
val r = drawer.bounds.offsetEdges(-100.0)
val triangle = Triangle(r.position(0.5, 0.0), r.position(0.0, 1.0), r.position(1.0, 1.0))
val pts = listOf(triangle).uniform(1000, Random(0))
//val pts = listOf(triangle).uniform(1000, Random(0))
extend {
val pts = listOf(triangle).hash(1000, 0, (seconds*500.0).toInt())
drawer.clear(ColorRGBa.PINK)
drawer.stroke = null
drawer.contour(triangle.contour)