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

@@ -16,48 +16,46 @@ import org.openrndr.shape.Path3D
import java.io.File
import kotlin.math.cos
fun main() {
application {
configure {
width = 720
height = 720
multisample = WindowMultisample.SampleCount(4)
fun main() = application {
configure {
width = 720
height = 720
multisample = WindowMultisample.SampleCount(4)
}
program {
val vb = loadOBJasVertexBuffer("orx-obj-loader/test-data/non-planar.obj")
val md = readObjMeshData(File("orx-obj-loader/test-data/non-planar.obj").readLines())
val paths = md.wireframe().map {
Path3D.fromPoints(it, true)
}
program {
val vb = loadOBJasVertexBuffer("orx-obj-loader/test-data/non-planar.obj")
val md = readObjMeshData(File("orx-obj-loader/test-data/non-planar.obj").readLines())
val paths = md.wireframe().map {
Path3D.fromPoints(it, true)
}
extend(Orbital())
extend {
drawer.rotate(Vector3.Companion.UNIT_Y, seconds * 45.0 + 45.0, TransformTarget.MODEL)
drawer.translate(0.0, 0.0, 9.0, TransformTarget.VIEW)
drawer.shadeStyle = shadeStyle {
fragmentTransform = """
extend(Orbital())
extend {
drawer.rotate(Vector3.Companion.UNIT_Y, seconds * 45.0 + 45.0, TransformTarget.MODEL)
drawer.translate(0.0, 0.0, 9.0, TransformTarget.VIEW)
drawer.shadeStyle = shadeStyle {
fragmentTransform = """
x_fill.rgb = normalize(v_viewNormal) * 0.5 + vec3(0.5);
""".trimIndent()
}
}
drawer.vertexBuffer(vb, DrawPrimitive.TRIANGLES)
drawer.stroke = ColorRGBa.WHITE
drawer.strokeWeight = 1.0
drawer.vertexBuffer(vb, DrawPrimitive.TRIANGLES)
drawer.stroke = ColorRGBa.WHITE
drawer.strokeWeight = 1.0
drawer.shadeStyle = shadeStyle {
vertexTransform = """
drawer.shadeStyle = shadeStyle {
vertexTransform = """
x_projectionMatrix[3][2] -= 0.001;
""".trimIndent()
}
drawer.strokeWeight = 1.0
drawer.paths(paths.mapIndexed { index, it ->
it.sub(
0.0, cos(seconds * 0.5 + index * 0.5) * 0.5 + 0.5
)
})
}
drawer.strokeWeight = 1.0
drawer.paths(paths.mapIndexed { index, it ->
it.sub(
0.0, cos(seconds * 0.5 + index * 0.5) * 0.5 + 0.5
)
})
}
}
}
}