[orx-jvm] Move panel, gui, dnk3, keyframer, triangulation to orx-jvm
This commit is contained in:
24
orx-jvm/orx-keyframer/src/demo/kotlin/DemoEvelope01.kt
Normal file
24
orx-jvm/orx-keyframer/src/demo/kotlin/DemoEvelope01.kt
Normal file
@@ -0,0 +1,24 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.keyframer.Keyframer
|
||||
import org.openrndr.resourceUrl
|
||||
import java.net.URL
|
||||
|
||||
suspend fun main() = application {
|
||||
program {
|
||||
class Animation: Keyframer() {
|
||||
val position by Vector2Channel(arrayOf("x", "y"))
|
||||
}
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-envelope-01.json")))
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
animation(seconds)
|
||||
drawer.circle(animation.position, 100.0)
|
||||
}
|
||||
}
|
||||
}
|
||||
28
orx-jvm/orx-keyframer/src/demo/kotlin/DemoFull01.kt
Normal file
28
orx-jvm/orx-keyframer/src/demo/kotlin/DemoFull01.kt
Normal file
@@ -0,0 +1,28 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.keyframer.Keyframer
|
||||
import org.openrndr.extra.keyframer.KeyframerFormat
|
||||
import org.openrndr.resourceUrl
|
||||
import java.net.URL
|
||||
|
||||
suspend fun main() = application {
|
||||
program {
|
||||
class Animation: Keyframer() {
|
||||
val position by Vector2Channel(arrayOf("x", "y"))
|
||||
val radius by DoubleChannel("radius")
|
||||
val color by RGBChannel(arrayOf("r", "g", "b"))
|
||||
}
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-full-01.json")), format = KeyframerFormat.FULL)
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
animation(seconds)
|
||||
drawer.fill = animation.color
|
||||
drawer.circle(animation.position, animation.radius)
|
||||
}
|
||||
}
|
||||
}
|
||||
52
orx-jvm/orx-keyframer/src/demo/kotlin/DemoScrub01.kt
Normal file
52
orx-jvm/orx-keyframer/src/demo/kotlin/DemoScrub01.kt
Normal file
@@ -0,0 +1,52 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.keyframer.Keyframer
|
||||
import org.openrndr.panel.controlManager
|
||||
import org.openrndr.panel.elements.Range
|
||||
import org.openrndr.panel.elements.Slider
|
||||
import org.openrndr.panel.elements.slider
|
||||
import org.openrndr.resourceUrl
|
||||
import java.net.URL
|
||||
|
||||
suspend fun main() = application {
|
||||
program {
|
||||
|
||||
// -- replace the default clock with an offset clock
|
||||
var clockOffset = 0.0
|
||||
val oldClock = clock
|
||||
clock = { oldClock() - clockOffset }
|
||||
var clockSlider: Slider? = null
|
||||
|
||||
// -- setup a simple UI
|
||||
val cm = controlManager {
|
||||
layout {
|
||||
clockSlider = slider {
|
||||
range = Range(0.0, 30.0)
|
||||
events.valueChanged.listen {
|
||||
if (it.interactive) {
|
||||
clockOffset = oldClock() - it.newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend(cm)
|
||||
class Animation: Keyframer() {
|
||||
val position by Vector2Channel(arrayOf("x", "y"))
|
||||
}
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-simple-01.json")))
|
||||
|
||||
extend {
|
||||
// -- update the slider
|
||||
clockSlider?.value = seconds
|
||||
animation(seconds)
|
||||
drawer.circle(animation.position, 100.0)
|
||||
}
|
||||
}
|
||||
}
|
||||
24
orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimple01.kt
Normal file
24
orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimple01.kt
Normal file
@@ -0,0 +1,24 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.keyframer.Keyframer
|
||||
import org.openrndr.resourceUrl
|
||||
import java.net.URL
|
||||
|
||||
suspend fun main() = application {
|
||||
program {
|
||||
class Animation: Keyframer() {
|
||||
val position by Vector2Channel(arrayOf("x", "y"))
|
||||
}
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-simple-01.json")))
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
animation(seconds)
|
||||
drawer.circle(animation.position, 100.0)
|
||||
}
|
||||
}
|
||||
}
|
||||
27
orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimple02.kt
Normal file
27
orx-jvm/orx-keyframer/src/demo/kotlin/DemoSimple02.kt
Normal file
@@ -0,0 +1,27 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.keyframer.Keyframer
|
||||
import org.openrndr.resourceUrl
|
||||
import java.net.URL
|
||||
|
||||
suspend fun main() = application {
|
||||
program {
|
||||
class Animation: Keyframer() {
|
||||
val position by Vector2Channel(arrayOf("x", "y"))
|
||||
val radius by DoubleChannel("radius")
|
||||
val color by RGBChannel(arrayOf("r", "g", "b"))
|
||||
}
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-simple-02.json")))
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
animation(seconds)
|
||||
drawer.fill = animation.color
|
||||
drawer.circle(animation.position, animation.radius)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.keyframer.Keyframer
|
||||
import org.openrndr.resourceUrl
|
||||
import java.net.URL
|
||||
|
||||
suspend fun main() = application {
|
||||
program {
|
||||
class Animation : Keyframer() {
|
||||
val position by Vector2Channel(arrayOf("x", "y"))
|
||||
val radius by DoubleChannel("x")
|
||||
}
|
||||
|
||||
val animation = Animation()
|
||||
animation.loadFromJson(URL(resourceUrl("/demo-simple-expressions-01.json")),
|
||||
parameters = mapOf("cycleDuration" to 2.0))
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
animation(seconds)
|
||||
drawer.circle(animation.position, animation.radius)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user