[orx-noise] Tidy up demos
Produce 720px wide images.
Use main() = application { for reduced indentation
This commit is contained in:
@@ -7,10 +7,7 @@ import org.openrndr.draw.isolated
|
||||
import org.openrndr.extra.camera.Orbital
|
||||
import org.openrndr.extra.meshgenerators.sphereMesh
|
||||
import org.openrndr.extra.noise.hammersley.hammersley4D
|
||||
import org.openrndr.extra.noise.rsequence.rSeq4D
|
||||
import org.openrndr.math.Vector4
|
||||
import kotlin.math.abs
|
||||
import kotlin.math.min
|
||||
|
||||
/**
|
||||
* Demo that visualizes a 4D Hammersley point set in a 3D space, with colors determined by the 4th dimension.
|
||||
@@ -25,28 +22,26 @@ import kotlin.math.min
|
||||
* of the scene. Rendering occurs within the draw loop, providing continuous visualization
|
||||
* of the point distribution.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
}
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
}
|
||||
|
||||
program {
|
||||
val sphere = sphereMesh(radius = 0.1)
|
||||
extend(Orbital())
|
||||
extend {
|
||||
val points = (0 until 10000).map {
|
||||
(hammersley4D(it, 10000) - Vector4(0.5, 0.5, 0.5, 0.0)) * Vector4(10.0, 10.0, 10.0, 1.0)
|
||||
}
|
||||
for (point in points) {
|
||||
drawer.isolated {
|
||||
drawer.translate(point.xyz)
|
||||
drawer.fill = ColorRGBa.RED.toHSVa().shiftHue(point.w * 360.0).toRGBa()
|
||||
drawer.vertexBuffer(sphere, DrawPrimitive.TRIANGLES)
|
||||
}
|
||||
program {
|
||||
val sphere = sphereMesh(radius = 0.1)
|
||||
extend(Orbital())
|
||||
extend {
|
||||
val points = (0 until 10000).map {
|
||||
(hammersley4D(it, 10000) - Vector4(0.5, 0.5, 0.5, 0.0)) * Vector4(10.0, 10.0, 10.0, 1.0)
|
||||
}
|
||||
for (point in points) {
|
||||
drawer.isolated {
|
||||
drawer.translate(point.xyz)
|
||||
drawer.fill = ColorRGBa.RED.toHSVa().shiftHue(point.w * 360.0).toRGBa()
|
||||
drawer.vertexBuffer(sphere, DrawPrimitive.TRIANGLES)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user