Bump to OPENRNDR 0.3.45-rc.6

This commit is contained in:
Edwin Jakobs
2020-12-25 09:13:50 +01:00
parent 0b2d8991db
commit d39e1d0783
8 changed files with 175 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ def openrndrUseSnapshot = false
apply plugin: 'org.jetbrains.dokka'
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"
spekVersion = "2.0.12"
libfreenectVersion = "0.5.7-1.5.4"

View 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)
}
}
}

View 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)
}
}
}

View 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)
}
}
}
}

View 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)
}
}
}
}

View 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))
}
}
}
}
}

View File

@@ -26,9 +26,9 @@ fun main() = application {
translate(width * 0.5, height * 0.5)
fill = null
stroke = ColorRGBa.BLACK
lineJoin = LineJoin.ROUND
contour(contour)
fill = ColorRGBa.PINK.opacify(0.3)
circles(ints.map { it.position }, 10.0)
}
}

View 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
}
}
}
}
}