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

@@ -8,26 +8,24 @@ import org.openrndr.extra.shapes.tunni.withTunniLine
import org.openrndr.shape.Circle
import kotlin.math.cos
fun main() {
application {
program {
extend {
drawer.clear(ColorRGBa.WHITE)
drawer.fill = ColorRGBa.BLACK
val c = Circle(drawer.bounds.center, 200.0).contour
fun main() = application {
program {
extend {
drawer.clear(ColorRGBa.WHITE)
drawer.fill = ColorRGBa.BLACK
val c = Circle(drawer.bounds.center, 200.0).contour
drawer.fill = null
for (s in c.segments) {
val tp = s.tunniPoint
drawer.circle(tp, 10.0)
val sc = s.cubic
drawer.lineSegment(sc.control[0], sc.control[1])
//drawer.segment(s.withTunniPoint(tp + (mouse.position - drawer.bounds.center)/2.0))
drawer.segment(s.withTunniLine(s.tunniLine.position(0.5) + s.tunniLine.normal * cos(seconds) * 40.0))
drawer.fill = null
for (s in c.segments) {
val tp = s.tunniPoint
drawer.circle(tp, 10.0)
val sc = s.cubic
drawer.lineSegment(sc.control[0], sc.control[1])
//drawer.segment(s.withTunniPoint(tp + (mouse.position - drawer.bounds.center)/2.0))
drawer.segment(s.withTunniLine(s.tunniLine.position(0.5) + s.tunniLine.normal * cos(seconds) * 40.0))
}
drawer.contour(c)
}
drawer.contour(c)
}
}
}
}