Improve demos for better screenshots, cleanup
This commit is contained in:
@@ -16,6 +16,13 @@ enum class BackgroundColors {
|
||||
|
||||
fun main() = application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val gui = GUI()
|
||||
gui.compartmentsCollapsedByDefault = false
|
||||
val settings = @Description("Settings") object {
|
||||
@@ -24,11 +31,6 @@ fun main() = application {
|
||||
}
|
||||
|
||||
gui.add(settings)
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend(gui)
|
||||
extend {
|
||||
when(settings.option) {
|
||||
|
||||
@@ -11,6 +11,13 @@ import org.openrndr.shape.Circle
|
||||
*/
|
||||
fun main() = application {
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val gui = GUI()
|
||||
gui.compartmentsCollapsedByDefault = false
|
||||
|
||||
@@ -28,11 +35,6 @@ fun main() = application {
|
||||
var radii = mutableListOf(5.0, 6.0, 8.0, 14.0, 20.0, 30.0)
|
||||
}
|
||||
gui.add(settings)
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend(gui)
|
||||
extend {
|
||||
drawer.fill = settings.color
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.gui.GUI
|
||||
import org.openrndr.extra.parameters.Description
|
||||
import org.openrndr.extra.parameters.XYParameter
|
||||
@@ -11,7 +12,15 @@ fun main() = application {
|
||||
}
|
||||
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val gui = GUI()
|
||||
gui.compartmentsCollapsedByDefault = false
|
||||
|
||||
val settings = @Description("Settings") object {
|
||||
@XYParameter("Position", 0.0, 800.0, 0.0, 800.0,
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.openrndr.extra.jumpfill.ops.*
|
||||
import org.openrndr.math.Vector3
|
||||
import org.openrndr.math.transforms.transform
|
||||
import org.openrndr.svg.loadSVG
|
||||
import kotlin.math.min
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
@@ -32,6 +33,7 @@ fun main() {
|
||||
|
||||
val strokeFill = SDFStrokeFill()
|
||||
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
@@ -50,14 +52,14 @@ fun main() {
|
||||
sdf1.setShapes(shapes.mapIndexed { index, it ->
|
||||
it.transform(transform {
|
||||
translate(1280 / 2.0, 720.0 / 2)
|
||||
rotate(Vector3.Companion.UNIT_Z, seconds * 45.0)
|
||||
rotate(Vector3.Companion.UNIT_Z, seconds * 45.0 - 30.0)
|
||||
translate(-1280 / 2.0, -720.0 / 2.0)
|
||||
})
|
||||
})
|
||||
|
||||
sdf0.apply(emptyArray(), df0)
|
||||
sdf1.apply(emptyArray(), df1)
|
||||
union.radius = mouse.position.y
|
||||
union.radius = 10.0 + min(mouse.position.y, 100.0)
|
||||
union.apply(arrayOf(df0, df1), df0)
|
||||
onion.radius = 20.0
|
||||
onion.apply(df0, df0)
|
||||
|
||||
@@ -15,6 +15,13 @@ fun main() = application {
|
||||
}
|
||||
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val rabbit = RabbitControlServer()
|
||||
val font= loadFont("orx-rabbit-control/src/demo/resources/fonts/Roboto-Regular.ttf", 20.0)
|
||||
val settings = object {
|
||||
@@ -49,11 +56,6 @@ fun main() = application {
|
||||
}
|
||||
|
||||
rabbit.add(settings)
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend(rabbit)
|
||||
extend {
|
||||
drawer.clear(if (settings.b) ColorRGBa.BLUE else ColorRGBa.BLACK)
|
||||
|
||||
@@ -12,6 +12,13 @@ fun main() = application {
|
||||
}
|
||||
|
||||
program {
|
||||
// -- this block is for automation purposes only
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
val rabbit = RabbitControlServer(showQRUntilClientConnects = false)
|
||||
|
||||
val settings = object {
|
||||
@@ -20,11 +27,6 @@ fun main() = application {
|
||||
}
|
||||
|
||||
rabbit.add(settings)
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend(rabbit)
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.draw.isolated
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.shapes.RoundedRectangle
|
||||
import org.openrndr.extra.shapes.regularPolygon
|
||||
import org.openrndr.extra.shapes.regularStar
|
||||
import org.openrndr.math.map
|
||||
import kotlin.math.cos
|
||||
import kotlin.math.sin
|
||||
|
||||
fun main() = application {
|
||||
program {
|
||||
@@ -18,12 +17,21 @@ fun main() = application {
|
||||
extend {
|
||||
drawer.fill = ColorRGBa.PINK
|
||||
drawer.stroke = ColorRGBa.WHITE
|
||||
val radius0 = cos(seconds) * 50.0 + 130.0
|
||||
val star = regularPolygon(6, radius = radius0)
|
||||
|
||||
drawer.translate(width/2.0, height / 2.0)
|
||||
drawer.rotate(seconds * 45.0)
|
||||
drawer.contour(star)
|
||||
for (sides in 0 until 8) {
|
||||
val radius0 = cos(seconds + sides) * 20.0 + 40.0
|
||||
val star = regularPolygon(sides + 3, radius = radius0)
|
||||
|
||||
drawer.isolated {
|
||||
translate(
|
||||
(sides % 4.0).map(0.0, 3.0,
|
||||
width * 0.2, width * 0.8),
|
||||
(sides / 4).toDouble().map(0.0, 1.0,
|
||||
height * 0.3, height * 0.7))
|
||||
rotate(seconds * 45.0)
|
||||
contour(star)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
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
|
||||
@@ -17,8 +16,8 @@ fun main() = application {
|
||||
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 radius0 = cos(seconds + 2) * 50.0 + 130.0
|
||||
val radius1 = sin(seconds + 2) * 50.0 + 130.0
|
||||
|
||||
val star = regularStar(5, radius0, radius1)
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
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 org.openrndr.math.Vector2
|
||||
import kotlin.math.cos
|
||||
|
||||
@@ -13,6 +13,7 @@ fun main() {
|
||||
val rotation = LFO(LFOWave.Sine)
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.delayFrames = 10
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user