Add screenshot generation
This commit is contained in:
@@ -11,6 +11,7 @@ sourceSets {
|
||||
dependencies {
|
||||
demoImplementation(project(":orx-camera"))
|
||||
demoImplementation("org.openrndr:openrndr-core:$openrndrVersion")
|
||||
demoImplementation("org.openrndr:openrndr-extensions:$openrndrVersion")
|
||||
demoRuntimeOnly("org.openrndr:openrndr-gl3:$openrndrVersion")
|
||||
demoRuntimeOnly("org.openrndr:openrndr-gl3-natives-$openrndrOS:$openrndrVersion")
|
||||
|
||||
|
||||
@@ -3,8 +3,10 @@ import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.draw.DrawPrimitive
|
||||
import org.openrndr.draw.colorBuffer
|
||||
import org.openrndr.draw.shadeStyle
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extras.camera.Orbital
|
||||
import org.openrndr.extras.meshgenerators.boxMesh
|
||||
import org.openrndr.math.Vector3
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
@@ -18,8 +20,14 @@ fun main() {
|
||||
}
|
||||
}
|
||||
s.upload()
|
||||
|
||||
extend(Orbital())
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend(Orbital()) {
|
||||
eye = Vector3(1.0, 1.0, 1.0)
|
||||
}
|
||||
extend {
|
||||
drawer.background(ColorRGBa.PINK)
|
||||
drawer.shadeStyle = shadeStyle {
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.draw.DrawPrimitive
|
||||
import org.openrndr.draw.shadeStyle
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extras.camera.Orbital
|
||||
import org.openrndr.extras.meshgenerators.box
|
||||
import org.openrndr.extras.meshgenerators.group
|
||||
import org.openrndr.extras.meshgenerators.meshGenerator
|
||||
import org.openrndr.extras.meshgenerators.sphere
|
||||
import org.openrndr.math.Vector3
|
||||
import org.openrndr.math.transforms.transform
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
extend(Orbital())
|
||||
val m = meshGenerator {
|
||||
sphere(32, 32, 1.0)
|
||||
group {
|
||||
@@ -21,6 +22,16 @@ fun main() {
|
||||
})
|
||||
}
|
||||
}
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend(Orbital()) {
|
||||
this.eye = Vector3(0.0, 3.0, 7.0)
|
||||
this.lookAt = Vector3(0.0, 2.0, 0.0)
|
||||
}
|
||||
|
||||
extend {
|
||||
drawer.shadeStyle = shadeStyle {
|
||||
fragmentTransform = """
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.draw.DrawPrimitive
|
||||
import org.openrndr.draw.shadeStyle
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extras.camera.Orbital
|
||||
import org.openrndr.extras.meshgenerators.*
|
||||
import org.openrndr.math.Vector3
|
||||
@@ -9,7 +10,15 @@ import org.openrndr.math.transforms.transform
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
extend(Orbital())
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend(Orbital()) {
|
||||
this.eye = Vector3(0.0, 10.0, 20.0)
|
||||
this.lookAt = Vector3(0.0, 5.0, 0.0)
|
||||
}
|
||||
val m = meshGenerator {
|
||||
group {
|
||||
hemisphere(32, 16, 5.0)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.draw.DrawPrimitive
|
||||
import org.openrndr.draw.shadeStyle
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extras.camera.Orbital
|
||||
import org.openrndr.extras.meshgenerators.*
|
||||
import org.openrndr.math.Vector3
|
||||
@@ -9,7 +10,15 @@ import org.openrndr.math.transforms.transform
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
extend(Orbital())
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend(Orbital()) {
|
||||
this.eye = Vector3(0.0, 10.0, 20.0)
|
||||
this.lookAt = Vector3(0.0, 5.0, 0.0)
|
||||
}
|
||||
val m = meshGenerator {
|
||||
group {
|
||||
hemisphere(32, 16, 5.0)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.draw.DrawPrimitive
|
||||
import org.openrndr.draw.shadeStyle
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extras.camera.Orbital
|
||||
import org.openrndr.extras.meshgenerators.*
|
||||
import org.openrndr.math.Vector2
|
||||
@@ -10,7 +11,16 @@ import org.openrndr.math.transforms.transform
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
extend(Orbital())
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
|
||||
extend(Orbital()) {
|
||||
this.eye = Vector3(0.0, 15.0, 15.0)
|
||||
}
|
||||
|
||||
val m = meshGenerator {
|
||||
val sides = 12
|
||||
group {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.draw.DrawPrimitive
|
||||
import org.openrndr.draw.shadeStyle
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extras.camera.Orbital
|
||||
import org.openrndr.extras.meshgenerators.*
|
||||
import org.openrndr.math.Vector2
|
||||
@@ -11,7 +12,14 @@ import org.openrndr.shape.Circle
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
extend(Orbital())
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend(Orbital()) {
|
||||
this.eye = Vector3(0.0, 30.0, 50.0)
|
||||
}
|
||||
val m = meshGenerator {
|
||||
|
||||
grid(5,5, 5) { u, v, w ->
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.draw.DrawPrimitive
|
||||
import org.openrndr.draw.shadeStyle
|
||||
import org.openrndr.extras.camera.Orbital
|
||||
import org.openrndr.extras.meshgenerators.*
|
||||
import org.openrndr.math.Vector2
|
||||
import org.openrndr.math.Vector3
|
||||
import org.openrndr.math.transforms.transform
|
||||
import org.openrndr.shape.Circle
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
extend(Orbital())
|
||||
val m = meshGenerator {
|
||||
|
||||
grid(5,5, 5) { u, v, w ->
|
||||
extrudeShape(Circle(0.0, 0.0, 50.0).shape, 4.0, scale = 0.1)
|
||||
transform(transform{ translate(u*20.0, v*20.0, w * 20.0)} )
|
||||
}
|
||||
twist(360.0/200.0, 0.0)
|
||||
twist(360.0/200.0, 0.0, Vector3.UNIT_X)
|
||||
twist(360.0/200.0, 0.0, Vector3.UNIT_Z)
|
||||
}
|
||||
extend {
|
||||
drawer.shadeStyle = shadeStyle {
|
||||
fragmentTransform = """
|
||||
x_fill.rgb *= v_viewNormal.z;
|
||||
""".trimIndent()
|
||||
}
|
||||
drawer.vertexBuffer(m, DrawPrimitive.TRIANGLES)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user