[orx-noise] Tidy up demos
Produce 720px wide images.
Use main() = application { for reduced indentation
This commit is contained in:
@@ -8,20 +8,18 @@ import org.openrndr.extra.noise.rsequence.rSeq2D
|
||||
* demonstrating 2D quasirandomly distributed points. The points are generated
|
||||
* using the R2 sequence and drawn as circles with a radius of 5.0.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
}
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
}
|
||||
|
||||
program {
|
||||
extend {
|
||||
val points = (0 until 4000).map {
|
||||
rSeq2D(it) * 720.0
|
||||
}
|
||||
drawer.circles(points, 5.0)
|
||||
program {
|
||||
extend {
|
||||
val points = (0 until 4000).map {
|
||||
rSeq2D(it) * 720.0
|
||||
}
|
||||
drawer.circles(points, 5.0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,27 +19,25 @@ import org.openrndr.math.Vector3
|
||||
* - Generation of quasirandom points in 3D space using the `rSeq3D` function.
|
||||
* - Transformation and rendering of each point as a sphere using vertex buffers.
|
||||
*/
|
||||
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 1400).map {
|
||||
(rSeq3D(it) - Vector3(0.5)) * 10.0
|
||||
}
|
||||
for (point in points) {
|
||||
drawer.isolated {
|
||||
drawer.translate(point)
|
||||
drawer.vertexBuffer(sphere, DrawPrimitive.TRIANGLES)
|
||||
}
|
||||
program {
|
||||
val sphere = sphereMesh(radius = 0.1)
|
||||
extend(Orbital())
|
||||
extend {
|
||||
val points = (0 until 1400).map {
|
||||
(rSeq3D(it) - Vector3(0.5)) * 10.0
|
||||
}
|
||||
for (point in points) {
|
||||
drawer.isolated {
|
||||
drawer.translate(point)
|
||||
drawer.vertexBuffer(sphere, DrawPrimitive.TRIANGLES)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,28 +27,26 @@ import kotlin.math.min
|
||||
* of the point and its color calculated by shifting the hue of a base color using
|
||||
* the w-coordinate value.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
}
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
}
|
||||
|
||||
program {
|
||||
val sphere = sphereMesh(radius = 0.1)
|
||||
val points = (0 until 10000).map {
|
||||
(rSeq4D(it) - Vector4(0.5, 0.5, 0.5, 0.0)) * Vector4(10.0, 10.0, 10.0, 1.0)
|
||||
}
|
||||
extend(Orbital())
|
||||
extend {
|
||||
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)
|
||||
val points = (0 until 10000).map {
|
||||
(rSeq4D(it) - Vector4(0.5, 0.5, 0.5, 0.0)) * Vector4(10.0, 10.0, 10.0, 1.0)
|
||||
}
|
||||
extend(Orbital())
|
||||
extend {
|
||||
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