Upgrade to OPENRNDR 0.3.42-rc.9, add DemoRegularStar02

This commit is contained in:
Edwin Jakobs
2020-05-14 10:11:38 +02:00
parent 5decae806e
commit ca53dfe902
3 changed files with 46 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extra.shapes.RoundedRectangle
import org.openrndr.extra.shapes.regularStar
import kotlin.math.cos
import kotlin.math.sin
fun main() = application {
program {
// -- this block is for automation purposes only
if (System.getProperty("takeScreenshot") == "true") {
extend(SingleScreenshot()) {
this.outputFile = System.getProperty("screenshotPath")
}
}
extend {
drawer.fill = ColorRGBa.PINK
drawer.stroke = ColorRGBa.WHITE
val radius0 = cos(seconds) * 50.0 + 130.0
val radius1 = sin(seconds) * 50.0 + 130.0
val star = regularStar(5, radius0, radius1)
drawer.translate(width/2.0, height / 2.0)
drawer.rotate(seconds * 45.0)
drawer.contour(star)
}
}
}