Bump to OPENRNDR 0.3.45-rc.6
This commit is contained in:
@@ -18,7 +18,7 @@ def openrndrUseSnapshot = false
|
|||||||
apply plugin: 'org.jetbrains.dokka'
|
apply plugin: 'org.jetbrains.dokka'
|
||||||
|
|
||||||
project.ext {
|
project.ext {
|
||||||
openrndrVersion = openrndrUseSnapshot? "0.4.0-SNAPSHOT" : "0.3.45-rc.5"
|
openrndrVersion = openrndrUseSnapshot? "0.4.0-SNAPSHOT" : "0.3.45-rc.6"
|
||||||
kotlinVersion = "1.4.0"
|
kotlinVersion = "1.4.0"
|
||||||
spekVersion = "2.0.12"
|
spekVersion = "2.0.12"
|
||||||
libfreenectVersion = "0.5.7-1.5.4"
|
libfreenectVersion = "0.5.7-1.5.4"
|
||||||
|
|||||||
30
openrndr-demos/src/demo/kotlin/DemoAnimation01.kt
Normal file
30
openrndr-demos/src/demo/kotlin/DemoAnimation01.kt
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import org.openrndr.animatable.Animatable
|
||||||
|
import org.openrndr.animatable.easing.Easing
|
||||||
|
import org.openrndr.application
|
||||||
|
import org.openrndr.math.Vector2
|
||||||
|
import org.openrndr.shape.contour
|
||||||
|
|
||||||
|
fun main() = application {
|
||||||
|
program {
|
||||||
|
class A: Animatable() {
|
||||||
|
var x = 0.0
|
||||||
|
var y = Vector2(200.0, 200.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
val a = A()
|
||||||
|
a.apply {
|
||||||
|
::y.animate(Vector2.ZERO, 10000, Easing.CubicInOut)
|
||||||
|
::x.animate(100.0, 5000).completed.listen {
|
||||||
|
println("hello world")
|
||||||
|
::x.animate(1.0, 5000).completed.listen {
|
||||||
|
println("we meet again")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extend {
|
||||||
|
a.updateAnimation()
|
||||||
|
drawer.circle(a.y, 10.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
25
openrndr-demos/src/demo/kotlin/DemoAnimation02.kt
Normal file
25
openrndr-demos/src/demo/kotlin/DemoAnimation02.kt
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import org.openrndr.animatable.Animatable
|
||||||
|
import org.openrndr.animatable.easing.Easing
|
||||||
|
import org.openrndr.application
|
||||||
|
import org.openrndr.math.Vector2
|
||||||
|
import org.openrndr.shape.contour
|
||||||
|
|
||||||
|
fun main() = application {
|
||||||
|
program {
|
||||||
|
val a = object {
|
||||||
|
var x = 0.0
|
||||||
|
}
|
||||||
|
|
||||||
|
animate {
|
||||||
|
updateAnimation()
|
||||||
|
a::x.animate(1000.0, 5000, Easing.CubicInOut)
|
||||||
|
a::x.complete()
|
||||||
|
a::x.animate(0.0, 5000, Easing.CubicInOut)
|
||||||
|
|
||||||
|
}
|
||||||
|
extend {
|
||||||
|
drawer.circle(a.x, height/2.0, 40.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
25
openrndr-demos/src/demo/kotlin/DemoCompositionDrawer02.kt
Normal file
25
openrndr-demos/src/demo/kotlin/DemoCompositionDrawer02.kt
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import org.openrndr.application
|
||||||
|
import org.openrndr.color.ColorRGBa
|
||||||
|
import org.openrndr.shape.ClipMode
|
||||||
|
import org.openrndr.shape.drawComposition
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
application {
|
||||||
|
program {
|
||||||
|
val cd = drawComposition {
|
||||||
|
fill = null
|
||||||
|
circle(width / 2.0, height / 2.0, 100.0)
|
||||||
|
|
||||||
|
fill = ColorRGBa.BLACK
|
||||||
|
clipMode = ClipMode.REVERSE_DIFFERENCE
|
||||||
|
circle(width / 2.0 + 50.0, height / 2.0, 100.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extend {
|
||||||
|
drawer.clear(ColorRGBa.PINK)
|
||||||
|
drawer.composition(cd)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
27
openrndr-demos/src/demo/kotlin/DemoCompositionDrawer03.kt
Normal file
27
openrndr-demos/src/demo/kotlin/DemoCompositionDrawer03.kt
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import org.openrndr.application
|
||||||
|
import org.openrndr.color.ColorRGBa
|
||||||
|
import org.openrndr.shape.ClipMode
|
||||||
|
import org.openrndr.shape.drawComposition
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
application {
|
||||||
|
program {
|
||||||
|
val cd = drawComposition {
|
||||||
|
fill = null
|
||||||
|
clipMode = ClipMode.REVERSE_DIFFERENCE
|
||||||
|
|
||||||
|
circle(width / 2.0-50.0, height / 2.0, 100.0)
|
||||||
|
circle(width / 2.0+50.0, height / 2.0, 100.0)
|
||||||
|
|
||||||
|
fill = ColorRGBa.BLACK
|
||||||
|
circle(width / 2.0, height / 2.0, 100.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extend {
|
||||||
|
drawer.clear(ColorRGBa.PINK)
|
||||||
|
drawer.composition(cd)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
45
openrndr-demos/src/demo/kotlin/DemoContour03.kt
Normal file
45
openrndr-demos/src/demo/kotlin/DemoContour03.kt
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import org.openrndr.application
|
||||||
|
import org.openrndr.color.ColorRGBa
|
||||||
|
import org.openrndr.draw.isolated
|
||||||
|
import org.openrndr.shape.Circle
|
||||||
|
import org.openrndr.shape.Rectangle
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
application {
|
||||||
|
configure {
|
||||||
|
width = 720
|
||||||
|
height = 720
|
||||||
|
}
|
||||||
|
|
||||||
|
program {
|
||||||
|
|
||||||
|
val cs = Rectangle(0.0, 0.0, 200.0, 200.0).contour
|
||||||
|
val cc = Circle(100.0, 0.0, 100.0).contour
|
||||||
|
|
||||||
|
extend {
|
||||||
|
drawer.fill = ColorRGBa.GRAY
|
||||||
|
drawer.stroke = ColorRGBa.PINK
|
||||||
|
drawer.isolated {
|
||||||
|
drawer.contour(cs)
|
||||||
|
drawer.translate(300.0, 0.0)
|
||||||
|
|
||||||
|
// this should create a contour similar to the input contour
|
||||||
|
drawer.contour(cs.sampleEquidistant(4))
|
||||||
|
drawer.contour(cs.sampleEquidistant(3))
|
||||||
|
}
|
||||||
|
|
||||||
|
drawer.isolated {
|
||||||
|
drawer.translate(.0, 400.0)
|
||||||
|
drawer.contour(cc)
|
||||||
|
drawer.translate(300.0, 0.0)
|
||||||
|
|
||||||
|
drawer.contour(cc)
|
||||||
|
// this should draw a hexagon
|
||||||
|
drawer.contour(cc.sampleEquidistant(6))
|
||||||
|
// this should draw a triangle
|
||||||
|
drawer.contour(cc.sampleEquidistant(3))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,9 +26,9 @@ fun main() = application {
|
|||||||
translate(width * 0.5, height * 0.5)
|
translate(width * 0.5, height * 0.5)
|
||||||
fill = null
|
fill = null
|
||||||
stroke = ColorRGBa.BLACK
|
stroke = ColorRGBa.BLACK
|
||||||
lineJoin = LineJoin.ROUND
|
|
||||||
contour(contour)
|
contour(contour)
|
||||||
fill = ColorRGBa.PINK.opacify(0.3)
|
fill = ColorRGBa.PINK.opacify(0.3)
|
||||||
|
|
||||||
circles(ints.map { it.position }, 10.0)
|
circles(ints.map { it.position }, 10.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
21
openrndr-demos/src/demo/kotlin/DemoMouseCursor01.kt
Normal file
21
openrndr-demos/src/demo/kotlin/DemoMouseCursor01.kt
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import org.openrndr.CursorType
|
||||||
|
import org.openrndr.application
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
application {
|
||||||
|
program {
|
||||||
|
keyboard.character.listen {
|
||||||
|
if (it.character == 'c') {
|
||||||
|
mouse.cursorVisible = !mouse.cursorVisible
|
||||||
|
}
|
||||||
|
}
|
||||||
|
extend {
|
||||||
|
if (mouse.position.x < width/2.0) {
|
||||||
|
mouse.cursorType = CursorType.ARROW_CURSOR
|
||||||
|
} else {
|
||||||
|
mouse.cursorType = CursorType.HAND_CURSOR
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user