Files
orx/orx-shapes/src/jvmDemo/kotlin/primitives/DemoNet01.kt
Abe Pazos c8f7dd52c6 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
2025-01-26 20:57:04 +01:00

33 lines
918 B
Kotlin

package primitives
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extra.shapes.primitives.Net
import org.openrndr.shape.Circle
import kotlin.math.sin
fun main() = application {
program {
extend {
drawer.clear(ColorRGBa.BLACK)
drawer.stroke = ColorRGBa.WHITE
drawer.fill = ColorRGBa.PINK
val a = drawer.bounds.position(0.7, 0.5)
val b = drawer.bounds.position(0.3, 0.5)
val c = Circle(
drawer.bounds.position(
sin(seconds) * 0.35 + 0.5,
sin(seconds * 2) * 0.25 + 0.5
), 50.0
)
val net = Net(a, b, c)
drawer.circle(a, 10.0)
drawer.circle(b, 10.0)
drawer.circle(c)
drawer.strokeWeight = 2.0
drawer.contour(net.contour)
}
}
}