Demos: ensure 720px wide, reduce indentation
This commit is contained in:
@@ -9,38 +9,36 @@ import org.openrndr.extra.meshgenerators.buildTriangleMesh
|
||||
import org.openrndr.extra.meshgenerators.sphere
|
||||
import org.openrndr.math.Vector3
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
multisample = WindowMultisample.SampleCount(8)
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
multisample = WindowMultisample.SampleCount(8)
|
||||
}
|
||||
program {
|
||||
val m = buildTriangleMesh {
|
||||
color = ColorRGBa.PINK
|
||||
sphere(32, 32, 1.0)
|
||||
|
||||
color = ColorRGBa.WHITE
|
||||
translate(0.0, -2.0, 0.0)
|
||||
box(4.0, 4.0, 4.0)
|
||||
|
||||
}
|
||||
program {
|
||||
val m = buildTriangleMesh {
|
||||
color = ColorRGBa.PINK
|
||||
sphere(32, 32, 1.0)
|
||||
|
||||
color = ColorRGBa.WHITE
|
||||
translate(0.0, -2.0, 0.0)
|
||||
box(4.0, 4.0, 4.0)
|
||||
extend(Orbital()) {
|
||||
this.eye = Vector3(0.0, 3.0, 7.0)
|
||||
this.lookAt = Vector3(0.0, 2.0, 0.0)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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 = """
|
||||
extend {
|
||||
drawer.shadeStyle = shadeStyle {
|
||||
fragmentTransform = """
|
||||
x_fill = va_color;
|
||||
x_fill.rgb *= v_viewNormal.z;
|
||||
""".trimIndent()
|
||||
}
|
||||
drawer.vertexBuffer(m, DrawPrimitive.TRIANGLES)
|
||||
}
|
||||
drawer.vertexBuffer(m, DrawPrimitive.TRIANGLES)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user