Bump to OPENRNDR 0.3.44-rc.6, add demos
This commit is contained in:
@@ -16,7 +16,7 @@ buildscript {
|
|||||||
apply plugin: 'org.jetbrains.dokka'
|
apply plugin: 'org.jetbrains.dokka'
|
||||||
|
|
||||||
project.ext {
|
project.ext {
|
||||||
openrndrVersion = openrndrUseSnapshot? "0.4.0-SNAPSHOT" : "0.3.44-rc.5"
|
openrndrVersion = openrndrUseSnapshot? "0.4.0-SNAPSHOT" : "0.3.44-rc.6"
|
||||||
kotlinVersion = "1.3.72"
|
kotlinVersion = "1.3.72"
|
||||||
spekVersion = "2.0.11"
|
spekVersion = "2.0.11"
|
||||||
libfreenectVersion = "0.5.7-1.5.3"
|
libfreenectVersion = "0.5.7-1.5.3"
|
||||||
|
|||||||
30
openrndr-demos/src/demo/kotlin/DemoCatmullRom01.kt
Normal file
30
openrndr-demos/src/demo/kotlin/DemoCatmullRom01.kt
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
// Converting Catmull-Rom curves to Bezier
|
||||||
|
|
||||||
|
import org.openrndr.application
|
||||||
|
import org.openrndr.color.ColorRGBa
|
||||||
|
import org.openrndr.math.CatmullRomChain2
|
||||||
|
import org.openrndr.math.Polar
|
||||||
|
import org.openrndr.shape.ShapeContour
|
||||||
|
import org.openrndr.shape.toContour
|
||||||
|
|
||||||
|
fun main() = application {
|
||||||
|
program {
|
||||||
|
val points = List(6) { Polar(it * 70.0, 100.0).cartesian + drawer.bounds.center }
|
||||||
|
val cmr = CatmullRomChain2(points, 1.0, loop = true)
|
||||||
|
val contour = ShapeContour.fromPoints(cmr.positions(200), true)
|
||||||
|
|
||||||
|
extend {
|
||||||
|
drawer.run {
|
||||||
|
clear(ColorRGBa.WHITE)
|
||||||
|
fill = null
|
||||||
|
stroke = ColorRGBa.BLACK
|
||||||
|
contour(contour)
|
||||||
|
circles(points, 5.0)
|
||||||
|
|
||||||
|
stroke = ColorRGBa.RED
|
||||||
|
contour(cmr.toContour())
|
||||||
|
fill = ColorRGBa.BLACK
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
22
openrndr-demos/src/demo/kotlin/DemoPointBatch01.kt
Normal file
22
openrndr-demos/src/demo/kotlin/DemoPointBatch01.kt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
// Drawing points using a stored batch
|
||||||
|
|
||||||
|
import org.openrndr.application
|
||||||
|
import org.openrndr.color.ColorRGBa
|
||||||
|
import org.openrndr.draw.pointBatch
|
||||||
|
|
||||||
|
fun main() = application {
|
||||||
|
program {
|
||||||
|
val storedBatch = drawer.pointBatch {
|
||||||
|
for (y in 10 until height step 20) {
|
||||||
|
for (x in 10 until width step 20) {
|
||||||
|
fill = ColorRGBa.PINK.shade(Math.random())
|
||||||
|
point(x * 1.0, y * 1.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
extend {
|
||||||
|
drawer.clear(ColorRGBa.GRAY)
|
||||||
|
drawer.points(storedBatch)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user