Demos: ensure 720px wide, reduce indentation

This commit is contained in:
Abe Pazos
2025-01-24 23:05:40 +01:00
parent ca8fbc1c0a
commit f84bf69713
31 changed files with 961 additions and 964 deletions

View File

@@ -11,38 +11,36 @@ import org.openrndr.extra.meshgenerators.twist
import org.openrndr.math.Vector3
import org.openrndr.shape.Circle
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 {
extend(Orbital()) {
this.eye = Vector3(0.0, 30.0, 50.0)
}
program {
extend(Orbital()) {
this.eye = Vector3(0.0, 30.0, 50.0)
}
val m = buildTriangleMesh {
grid(5, 5, 5) { u, v, w ->
isolated {
translate(u * 20.0, v * 20.0, w * 20.0)
extrudeShape(Circle(0.0, 0.0, 50.0).shape, 4.0, scale = 0.1)
}
val m = buildTriangleMesh {
grid(5, 5, 5) { u, v, w ->
isolated {
translate(u * 20.0, v * 20.0, w * 20.0)
extrudeShape(Circle(0.0, 0.0, 50.0).shape, 4.0, scale = 0.1)
}
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)
}
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 = """
extend {
drawer.shadeStyle = shadeStyle {
fragmentTransform = """
x_fill.rgb *= v_viewNormal.z;
""".trimIndent()
}
drawer.drawStyle.cullTestPass = CullTestPass.FRONT
drawer.vertexBuffer(m, DrawPrimitive.TRIANGLES)
}
drawer.drawStyle.cullTestPass = CullTestPass.FRONT
drawer.vertexBuffer(m, DrawPrimitive.TRIANGLES)
}
}
}
}