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:
@@ -1,41 +1,38 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.draw.isolated
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.timeoperators.Envelope
|
||||
import org.openrndr.extra.timeoperators.TimeOperators
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
val size = Envelope(50.0, 400.0, 0.5, 0.5)
|
||||
val rotation = Envelope(easingFactor = 0.4)
|
||||
fun main() = application {
|
||||
program {
|
||||
val size = Envelope(50.0, 400.0, 0.5, 0.5)
|
||||
val rotation = Envelope(easingFactor = 0.4)
|
||||
|
||||
extend(TimeOperators()) {
|
||||
track(size, rotation)
|
||||
extend(TimeOperators()) {
|
||||
track(size, rotation)
|
||||
}
|
||||
extend {
|
||||
if (frameCount % 80 == 0) {
|
||||
size.trigger()
|
||||
}
|
||||
extend {
|
||||
if (frameCount % 80 == 0) {
|
||||
size.trigger()
|
||||
}
|
||||
|
||||
if (frameCount % 50 == 0) {
|
||||
rotation.trigger(180.0)
|
||||
}
|
||||
if (frameCount % 50 == 0) {
|
||||
rotation.trigger(180.0)
|
||||
}
|
||||
|
||||
drawer.isolated {
|
||||
drawer.stroke = ColorRGBa.PINK
|
||||
drawer.fill = ColorRGBa.PINK
|
||||
drawer.isolated {
|
||||
drawer.stroke = ColorRGBa.PINK
|
||||
drawer.fill = ColorRGBa.PINK
|
||||
|
||||
drawer.translate(width / 2.0, height / 2.0)
|
||||
drawer.rotate(rotation.value)
|
||||
drawer.translate(width / 2.0, height / 2.0)
|
||||
drawer.rotate(rotation.value)
|
||||
|
||||
val side = size.value / 2.0
|
||||
val offset = side / 2.0
|
||||
val side = size.value / 2.0
|
||||
val offset = side / 2.0
|
||||
|
||||
drawer.rectangle(0.0 - offset, 0.0 - offset, side, side)
|
||||
}
|
||||
drawer.rectangle(0.0 - offset, 0.0 - offset, side, side)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,33 +6,31 @@ import org.openrndr.extra.timeoperators.LFO
|
||||
import org.openrndr.extra.timeoperators.LFOWave
|
||||
import org.openrndr.extra.timeoperators.TimeOperators
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
val size = LFO()
|
||||
val rotation = LFO(LFOWave.Sine)
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extensions.filterIsInstance<SingleScreenshot>().forEach {
|
||||
it.delayFrames = 10
|
||||
}
|
||||
fun main() = application {
|
||||
program {
|
||||
val size = LFO()
|
||||
val rotation = LFO(LFOWave.Sine)
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extensions.filterIsInstance<SingleScreenshot>().forEach {
|
||||
it.delayFrames = 10
|
||||
}
|
||||
extend(TimeOperators()) {
|
||||
track(size, rotation)
|
||||
}
|
||||
extend {
|
||||
drawer.isolated {
|
||||
drawer.stroke = ColorRGBa.PINK
|
||||
drawer.fill = ColorRGBa.PINK
|
||||
}
|
||||
extend(TimeOperators()) {
|
||||
track(size, rotation)
|
||||
}
|
||||
extend {
|
||||
drawer.isolated {
|
||||
drawer.stroke = ColorRGBa.PINK
|
||||
drawer.fill = ColorRGBa.PINK
|
||||
|
||||
drawer.translate(width / 2.0, height / 2.0)
|
||||
drawer.rotate(rotation.sample() * 180.0)
|
||||
drawer.translate(width / 2.0, height / 2.0)
|
||||
drawer.rotate(rotation.sample() * 180.0)
|
||||
|
||||
val side = (size.sample(0.5) * 400.0) / 2.0
|
||||
val offset = side / 2.0
|
||||
val side = (size.sample(0.5) * 400.0) / 2.0
|
||||
val offset = side / 2.0
|
||||
|
||||
drawer.rectangle(0.0 - offset, 0.0 - offset, side, side)
|
||||
}
|
||||
drawer.rectangle(0.0 - offset, 0.0 - offset, side, side)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user