Demos: ensure all use fun main() = application {

- Adjust some demo window sizes.
- Replace Random.double by Double.uniform
- Tweak some demos so screenshots look more interesting
This commit is contained in:
Abe Pazos
2025-01-26 20:57:04 +01:00
parent 1975a820fc
commit c8f7dd52c6
116 changed files with 2889 additions and 2942 deletions

View File

@@ -7,35 +7,35 @@ import org.openrndr.math.Vector3
import org.openrndr.math.transforms.buildTransform
import org.openrndr.shape.Circle
fun main() {
application {
configure {
width = 750
height = 1000
}
program {
extend {
val r = drawer.bounds.offsetEdges(-100.0)
val grid = r.grid(3,6).flatten()
val circles = grid.map { Circle(Vector2.ZERO, 158.975).contour.transform(
fun main() = application {
configure {
width = 720
height = 1000
}
program {
extend {
val r = drawer.bounds.offsetEdges(-100.0)
val grid = r.grid(3, 6).flatten()
val circles = grid.map {
Circle(Vector2.ZERO, 158.975).contour.transform(
buildTransform {
translate(it.center)
rotate(Vector3.UNIT_Z, 0.0)
}
) }
val points = circles.flatMap { it.contour.equidistantPositions(16) }
drawer.circles(points, 5.0)
val d = points.delaunayTriangulation()
drawer.stroke = ColorRGBa.PINK
drawer.contours(d.halfedges())
drawer.stroke = ColorRGBa.YELLOW
drawer.fill = ColorRGBa.GRAY.opacify(0.5)
drawer.contours(d.voronoiDiagram(drawer.bounds).cellPolygons())
drawer.stroke = ColorRGBa.GRAY
drawer.contours(d.triangles().map { it.contour })
)
}
val points = circles.flatMap { it.contour.equidistantPositions(16) }
drawer.circles(points, 5.0)
val d = points.delaunayTriangulation()
drawer.stroke = ColorRGBa.PINK
drawer.contours(d.halfedges())
drawer.stroke = ColorRGBa.YELLOW
drawer.fill = ColorRGBa.GRAY.opacify(0.5)
drawer.contours(d.voronoiDiagram(drawer.bounds).cellPolygons())
drawer.stroke = ColorRGBa.GRAY
drawer.contours(d.triangles().map { it.contour })
}
}
}
}