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

@@ -12,38 +12,35 @@ import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.math.Vector3
import org.openrndr.shape.path3D
fun main() {
application {
configure {
width = 720
height = 720
multisample = WindowMultisample.SampleCount(4)
fun main() = application {
configure {
width = 720
height = 720
multisample = WindowMultisample.SampleCount(4)
}
program {
val p = path3D {
moveTo(0.0, 0.0, 0.0)
for (i in 0 until 10) {
curveTo(
Vector3.uniformRing(0.1, 1.0) * 10.0,
Vector3.uniformRing(0.1, 1.0) * 10.0,
Vector3.uniformRing(0.1, 1.0) * 10.0
)
}
}
program {
val p = path3D {
moveTo(0.0, 0.0, 0.0)
for (i in 0 until 10) {
curveTo(
Vector3.uniformRing(0.1, 1.0)*10.0,
Vector3.uniformRing(0.1, 1.0)*10.0,
Vector3.uniformRing(0.1, 1.0)*10.0
)
val pr = p.rectified(0.01, 100.0)
val sphere = sphereMesh(radius = 0.1)
extend(Orbital())
extend {
drawer.stroke = ColorRGBa.PINK
for (i in 0 until 500) {
drawer.isolated {
drawer.translate(pr.position(i / 499.0))
drawer.vertexBuffer(sphere, DrawPrimitive.TRIANGLES)
}
}
val pr = p.rectified(0.01, 100.0)
val sphere = sphereMesh(radius = 0.1)
extend(Orbital())
extend {
drawer.stroke = ColorRGBa.PINK
for (i in 0 until 500) {
drawer.isolated {
drawer.translate(pr.position(i/499.0))
drawer.vertexBuffer(sphere, DrawPrimitive.TRIANGLES)
}
}
drawer.path(p)
}
drawer.path(p)
}
}
}
}