[orx-noise] Add comments to all demos, add demo

This commit is contained in:
Abe Pazos
2025-08-30 13:54:25 +02:00
parent 935e7cd9a8
commit 878f2b040d
18 changed files with 156 additions and 23 deletions

View File

@@ -6,6 +6,12 @@ import org.openrndr.extra.noise.linearrange.uniform
import org.openrndr.extra.math.linearrange.rangeTo
import kotlin.random.Random
/**
* Demonstrates how to create a linear range with two [org.openrndr.shape.Rectangle]s.
*
* This range is then sampled at 100 random locations using the `uniform` method to get and render interpolated
* rectangles. The random seed changes once per second.
*/
fun main() {
application {
configure {
@@ -13,7 +19,9 @@ fun main() {
height = 720
}
program {
val range = drawer.bounds.offsetEdges(-300.0, -50.0) .. drawer.bounds.offsetEdges(-50.0, -300.0)
val rect1 = drawer.bounds.offsetEdges(-300.0, -50.0)
val rect2 = drawer.bounds.offsetEdges(-50.0, -300.0)
val range = rect1 .. rect2
extend {
drawer.fill = ColorRGBa.WHITE.opacify(0.9)
val r = Random(seconds.toInt())