Demos: ensure all use fun main() = application {
- Adjust some demo window sizes. - Replace Random.double by Double.uniform - Tweak some demos so screenshots look more interesting
This commit is contained in:
@@ -4,8 +4,7 @@ import org.openrndr.draw.isolated
|
||||
import org.openrndr.shape.Circle
|
||||
import org.openrndr.shape.Rectangle
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -41,4 +40,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,7 @@ import org.openrndr.shape.Triangle
|
||||
* a 3x3 grid of triangles and lines.
|
||||
*/
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -51,4 +50,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,10 @@ import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.extra.composition.composition
|
||||
import org.openrndr.extra.composition.drawComposition
|
||||
import org.openrndr.extra.svg.saveToFile
|
||||
import org.openrndr.extra.svg.toSVG
|
||||
import org.openrndr.math.Vector2
|
||||
import java.io.File
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val composition = drawComposition {
|
||||
val layer = group {
|
||||
@@ -39,4 +36,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,7 @@ import org.openrndr.extra.composition.ClipMode
|
||||
import org.openrndr.extra.composition.composition
|
||||
import org.openrndr.extra.composition.drawComposition
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val cd = drawComposition {
|
||||
fill = null
|
||||
@@ -23,4 +22,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,7 @@ import org.openrndr.extra.composition.ClipMode
|
||||
import org.openrndr.extra.composition.composition
|
||||
import org.openrndr.extra.composition.drawComposition
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val cd = drawComposition {
|
||||
fill = null
|
||||
@@ -18,11 +17,9 @@ fun main() {
|
||||
circle(width / 2.0, height / 2.0, 100.0)
|
||||
}
|
||||
|
||||
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.PINK)
|
||||
drawer.composition(cd)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -201,8 +201,7 @@ import org.openrndr.extra.fx.edges.EdgesWork
|
||||
import org.openrndr.extra.gui.GUI
|
||||
import org.openrndr.math.Vector2
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 768
|
||||
height = 768
|
||||
@@ -235,7 +234,6 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
<!-- __demos__ -->
|
||||
## Demos
|
||||
|
||||
@@ -6,14 +6,17 @@ import org.openrndr.extra.fx.blur.HashBlurDynamic
|
||||
import org.openrndr.extra.fx.patterns.Checkers
|
||||
import kotlin.math.cos
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
}
|
||||
program {
|
||||
val c = compose {
|
||||
layer {
|
||||
val a = aside(colorType = ColorType.FLOAT32) {
|
||||
post(Checkers()) {
|
||||
this.size = cos(seconds)*0.5 + 0.5
|
||||
this.size = cos(seconds + 2.0) * 0.5 + 0.5
|
||||
}
|
||||
}
|
||||
draw {
|
||||
@@ -31,4 +34,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,8 +17,8 @@ import kotlin.random.Random
|
||||
*/
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 900
|
||||
height = 900
|
||||
width = 720
|
||||
height = 720
|
||||
}
|
||||
|
||||
program {
|
||||
|
||||
@@ -14,10 +14,9 @@ import org.openrndr.shape.Rectangle
|
||||
* Try changing which layer has multisampling applied and observe the results.
|
||||
*/
|
||||
fun main() = application {
|
||||
System.setProperty("org.openrndr.gl3.debug", "true")
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
width = 720
|
||||
height = 720
|
||||
}
|
||||
|
||||
program {
|
||||
@@ -25,17 +24,17 @@ fun main() = application {
|
||||
layer(multisample = BufferMultisample.SampleCount(4)) {
|
||||
draw {
|
||||
drawer.translate(drawer.bounds.center)
|
||||
drawer.rotate(seconds)
|
||||
drawer.rotate(seconds + 5)
|
||||
drawer.fill = ColorRGBa.PINK
|
||||
drawer.rectangle(Rectangle.fromCenter(Vector2.ZERO, 200.0))
|
||||
}
|
||||
|
||||
layer {
|
||||
layer() {
|
||||
blend(Normal()) {
|
||||
clip = true
|
||||
}
|
||||
draw {
|
||||
drawer.rotate(seconds * -2)
|
||||
drawer.rotate((seconds + 5) * -2)
|
||||
drawer.fill = ColorRGBa.WHITE
|
||||
drawer.rectangle(Rectangle.fromCenter(Vector2.ZERO, 200.0))
|
||||
}
|
||||
|
||||
@@ -8,8 +8,7 @@ import org.openrndr.extra.gui.GUI
|
||||
import org.openrndr.extra.parameters.DoubleParameter
|
||||
import org.openrndr.math.Vector2
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val gui = GUI()
|
||||
|
||||
@@ -37,4 +36,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,7 @@ import org.openrndr.math.map
|
||||
* [grid] is used to layout graphs on rows and columns.
|
||||
*
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 1280
|
||||
height = 1080
|
||||
@@ -27,7 +26,7 @@ fun main() {
|
||||
).flatten()
|
||||
|
||||
// make pairs of (easing function, grid rectangle)
|
||||
val pairs = Easing.values() zip grid
|
||||
val pairs = Easing.entries.toTypedArray() zip grid
|
||||
|
||||
extend {
|
||||
// ~4 seconds animation loop
|
||||
@@ -77,4 +76,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,7 @@ import org.openrndr.application
|
||||
import org.openrndr.draw.loadFont
|
||||
import org.openrndr.extra.envelopes.ADSRTracker
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val tracker = ADSRTracker(this)
|
||||
tracker.attack = 1.0
|
||||
@@ -32,4 +31,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,7 @@ import org.openrndr.extra.envelopes.ADSRTracker
|
||||
import org.openrndr.extra.noise.shapes.uniform
|
||||
import org.openrndr.shape.Rectangle
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val tracker = ADSRTracker(this)
|
||||
tracker.attack = 1.0
|
||||
@@ -43,4 +42,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,7 @@ import org.openrndr.extra.gui.GUI
|
||||
import org.openrndr.extra.gui.addTo
|
||||
import org.openrndr.extra.parameters.TextParameter
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val gui = GUI()
|
||||
gui.compartmentsCollapsedByDefault = false
|
||||
@@ -43,4 +42,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,7 @@ import org.openrndr.extra.parameters.TextParameter
|
||||
* Improved version of DemoExpressionEvaluator01, it uses [watchingExpression1] to automatically convert an expression
|
||||
* string into a function with a parameter "t".
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val gui = GUI()
|
||||
gui.compartmentsCollapsedByDefault = false
|
||||
@@ -41,4 +40,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,8 +118,7 @@ Drawing FCurves is useful for debugging, but their typical use is for animation.
|
||||
The FCurve sampler allows us to query values for the given time value like this:
|
||||
|
||||
```kotlin
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val xCurve = fcurve(
|
||||
"""
|
||||
@@ -129,18 +128,18 @@ fun main() {
|
||||
S2,0, 2,320
|
||||
S2,0, 2,320
|
||||
T0.6,320
|
||||
""".trimIndent()
|
||||
).sampler() // <--
|
||||
"""
|
||||
)
|
||||
val xCurveSampler = xCurve.sampler()
|
||||
extend {
|
||||
drawer.circle(
|
||||
xCurve(seconds % 9.0),
|
||||
height * 0.5,
|
||||
xCurveSampler(seconds % 9.0),
|
||||
240.0,
|
||||
20.0
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
In this example we used `% 9.0` to loop the time between 0.0 and 9.0, repeating the animation over and over.
|
||||
@@ -194,6 +193,7 @@ For example `(M0 (h1 m1)[3])[2]` expands to `M0 h1 m1 h1 m1 h1 m1 M0 h1 m1 h1 m1
|
||||
|
||||
|
||||
# References
|
||||
|
||||
* https://x.com/ruby0x1/status/1258252352672247814
|
||||
* https://blender.stackexchange.com/questions/52403/what-is-the-mathematical-basis-for-f-curves/52468#52468
|
||||
* https://pomax.github.io/bezierinfo/#yforx
|
||||
@@ -210,6 +210,11 @@ For example `(M0 (h1 m1)[3])[2]` expands to `M0 h1 m1 h1 m1 h1 m1 M0 h1 m1 h1 m1
|
||||
|
||||

|
||||
|
||||
### DemoFCurve03
|
||||
[source code](src/jvmDemo/kotlin/DemoFCurve03.kt)
|
||||
|
||||

|
||||
|
||||
### DemoFCurveSheet01
|
||||
[source code](src/jvmDemo/kotlin/DemoFCurveSheet01.kt)
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extra.fcurve.fcurve
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -16,4 +15,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,7 @@ import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.extra.fcurve.fcurve
|
||||
import org.openrndr.math.Vector2
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -25,4 +24,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,17 +3,18 @@ import org.openrndr.extra.fcurve.MultiFCurve
|
||||
import org.openrndr.extra.fcurve.fcurve
|
||||
import org.openrndr.extra.fcurve.vector2
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
}
|
||||
program {
|
||||
class XYAnimation : MultiFCurve(mapOf(
|
||||
class XYAnimation : MultiFCurve(
|
||||
mapOf(
|
||||
"x" to fcurve("M0 Q4,360,5,720"),
|
||||
"y" to fcurve("M360 h5")
|
||||
)) {
|
||||
)
|
||||
) {
|
||||
val position = vector2("x", "y")
|
||||
}
|
||||
|
||||
@@ -25,4 +26,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,15 +9,14 @@ import org.openrndr.math.Vector2
|
||||
import org.openrndr.math.smoothstep
|
||||
import org.openrndr.math.transforms.buildTransform
|
||||
import org.openrndr.shape.LineSegment
|
||||
import kotlin.math.*
|
||||
import kotlin.math.max
|
||||
import kotlin.random.Random
|
||||
|
||||
/**
|
||||
* Demonstration of using FFT to filter a two-dimensional shape. Mouse xy-position is mapped
|
||||
* to lowpass and highpass settings of the filter.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -50,7 +49,9 @@ fun main() {
|
||||
}
|
||||
|
||||
val c = hobbyCurve(
|
||||
drawer.bounds.scatter(40.0, distanceToEdge = 100.0, random = Random(0)),
|
||||
drawer.bounds.scatter(30.0, distanceToEdge = 100.0, random = Random(3)).filter {
|
||||
Random.nextBoolean()
|
||||
},
|
||||
true
|
||||
).transform(buildTransform { translate(-drawer.bounds.center) })
|
||||
|
||||
@@ -79,8 +80,8 @@ fun main() {
|
||||
|
||||
val xpower = fft.magnitudeSum()
|
||||
|
||||
val lpc = mouse.position.x / width
|
||||
val hpc = mouse.position.y / height
|
||||
val hpc = mouse.position.x / width
|
||||
val lpc = mouse.position.y / height
|
||||
|
||||
for (i in 1..fftSize / 2) {
|
||||
val t = i.toDouble() / (fftSize / 2 - 1)
|
||||
@@ -109,9 +110,9 @@ fun main() {
|
||||
drawer.stroke = ColorRGBa.GRAY.shade(0.5)
|
||||
drawer.lineSegments((0 until fft.size / 2).map {
|
||||
LineSegment(
|
||||
it.toDouble() * 2.0 + 0.5,
|
||||
it * 2.0 + 0.5,
|
||||
height * 0.5,
|
||||
it.toDouble() * 2.0 + 0.5,
|
||||
it * 2.0 + 0.5,
|
||||
height * 0.5 + fft.magnitude(it) / 200.0,
|
||||
)
|
||||
})
|
||||
@@ -129,9 +130,9 @@ fun main() {
|
||||
drawer.stroke = ColorRGBa.PINK.opacify(0.7)
|
||||
drawer.lineSegments((0 until fft.size / 2).map {
|
||||
LineSegment(
|
||||
it.toDouble() * 2.0 + 0.5,
|
||||
it * 2.0 + 0.5,
|
||||
height * 0.5,
|
||||
it.toDouble() * 2.0 + 0.5,
|
||||
it * 2.0 + 0.5,
|
||||
height * 0.5 + fft.magnitude(it) / 200.0,
|
||||
)
|
||||
})
|
||||
@@ -153,4 +154,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extra.fx.blend.*
|
||||
fun main() {
|
||||
application {
|
||||
|
||||
fun main() = application {
|
||||
program {
|
||||
val add = Add()
|
||||
val colorBurn = ColorBurn()
|
||||
@@ -26,4 +26,3 @@ fun main() {
|
||||
application.exit()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,7 @@ import org.openrndr.extra.fx.blur.*
|
||||
import org.openrndr.math.Polar
|
||||
import kotlin.math.sin
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
// In this buffer we will draw some simple shapes
|
||||
val dry = renderTarget(width / 3, height / 3) {
|
||||
@@ -38,15 +37,19 @@ fun main() {
|
||||
fill = null
|
||||
stroke = ColorRGBa.PINK
|
||||
strokeWeight = 25.0
|
||||
circle(bounds.center +
|
||||
circle(
|
||||
bounds.center +
|
||||
Polar(seconds * 50.0, 100.0).cartesian,
|
||||
200.0 + 50.0 * sin(seconds * 2.0))
|
||||
200.0 + 50.0 * sin(seconds * 2.0)
|
||||
)
|
||||
|
||||
fill = ColorRGBa.PINK
|
||||
stroke = null
|
||||
circle(bounds.center +
|
||||
circle(
|
||||
bounds.center +
|
||||
Polar(seconds * 50.0 + 60, 100.0).cartesian,
|
||||
100.0 + 20.0 * sin(seconds * 2.0 + 1))
|
||||
100.0 + 20.0 * sin(seconds * 2.0 + 1)
|
||||
)
|
||||
}
|
||||
|
||||
effects.forEachIndexed { i, blur ->
|
||||
@@ -56,33 +59,40 @@ fun main() {
|
||||
is BoxBlur -> {
|
||||
blur.window = 30
|
||||
}
|
||||
|
||||
is ApproximateGaussianBlur -> {
|
||||
blur.window = 25
|
||||
blur.sigma = 15.0
|
||||
}
|
||||
|
||||
is HashBlur -> {
|
||||
blur.samples = 50
|
||||
blur.radius = 5.0
|
||||
blur.time = seconds
|
||||
}
|
||||
|
||||
is GaussianBlur -> {
|
||||
blur.window = 25
|
||||
blur.sigma = 15.0
|
||||
}
|
||||
|
||||
is GaussianBloom -> {
|
||||
blur.window = 5
|
||||
blur.sigma = 3.0
|
||||
blur.gain = 3.0
|
||||
blur.noiseSeed = seconds
|
||||
}
|
||||
|
||||
is FrameBlur -> {
|
||||
blur.blend = 0.05
|
||||
}
|
||||
|
||||
is ZoomBlur -> {
|
||||
blur.center = Polar(seconds * 77.0, 0.5)
|
||||
.cartesian
|
||||
blur.strength = 0.8
|
||||
}
|
||||
|
||||
is LaserBlur -> {
|
||||
blur.center = Polar(seconds * 77.0, 0.5)
|
||||
.cartesian
|
||||
@@ -97,8 +107,10 @@ fun main() {
|
||||
|
||||
// Draw `wet` and write the effect name on top
|
||||
drawer.isolated {
|
||||
translate((i % 3) * width / 3.0,
|
||||
(i / 3) * height / 3.0)
|
||||
translate(
|
||||
(i % 3) * width / 3.0,
|
||||
(i / 3) * height / 3.0
|
||||
)
|
||||
image(wet)
|
||||
fontMap = font
|
||||
text(blur.javaClass.simpleName, 20.0, 30.0)
|
||||
@@ -107,4 +119,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,7 @@ import org.openrndr.draw.createEquivalent
|
||||
import org.openrndr.draw.loadImage
|
||||
import org.openrndr.extra.fx.color.Duotone
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
|
||||
val image = loadImage("demo-data/images/image-001.png")
|
||||
@@ -18,4 +17,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,7 @@ import org.openrndr.draw.createEquivalent
|
||||
import org.openrndr.draw.loadImage
|
||||
import org.openrndr.extra.fx.color.Posterize
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val image = loadImage("demo-data/images/image-001.png")
|
||||
val filteredImage = image.createEquivalent()
|
||||
@@ -17,4 +16,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,7 @@ import org.openrndr.draw.loadImage
|
||||
import org.openrndr.extra.fx.colormap.GrayscaleColormap
|
||||
import kotlin.math.sin
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val colormap = GrayscaleColormap()
|
||||
val image = loadImage("demo-data/images/image-001.png")
|
||||
@@ -18,4 +17,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,7 @@ import org.openrndr.draw.loadImage
|
||||
import org.openrndr.extra.fx.colormap.SpectralZucconiColormap
|
||||
import kotlin.math.sin
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val colormap = SpectralZucconiColormap()
|
||||
val image = loadImage("demo-data/images/image-001.png")
|
||||
@@ -18,4 +17,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,7 @@ import org.openrndr.draw.loadImage
|
||||
import org.openrndr.extra.fx.colormap.TurboColormap
|
||||
import kotlin.math.sin
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val colormap = TurboColormap()
|
||||
val image = loadImage("demo-data/images/image-001.png")
|
||||
@@ -18,4 +17,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,7 @@ import org.openrndr.extra.noise.*
|
||||
import org.openrndr.math.smoothstep
|
||||
import kotlin.math.cos
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
extend(Post()) {
|
||||
// -- create a color buffer and fill it with random direction vectors
|
||||
@@ -23,7 +22,11 @@ fun main() {
|
||||
for (y in 0 until height) {
|
||||
for (x in 0 until width) {
|
||||
val a = smoothstep(0.4, 0.6, cos((x + y) * 0.01) * 0.5 + 0.5)
|
||||
val nv = n(2320, x.toDouble(), y.toDouble()) * smoothstep(0.45, 0.55, ng(1032, x.toDouble(), y.toDouble()))
|
||||
val nv = n(2320, x.toDouble(), y.toDouble()) * smoothstep(
|
||||
0.45,
|
||||
0.55,
|
||||
ng(1032, x.toDouble(), y.toDouble())
|
||||
)
|
||||
s[x, y] = ColorRGBa(nv.x, nv.y, 0.0, 1.0)
|
||||
}
|
||||
}
|
||||
@@ -60,4 +63,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,7 @@ import org.openrndr.draw.createEquivalent
|
||||
import org.openrndr.draw.loadImage
|
||||
import org.openrndr.extra.fx.dither.LumaHalftone
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val image = loadImage("demo-data/images/image-001.png")
|
||||
val filteredImage = image.createEquivalent()
|
||||
@@ -22,4 +21,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,7 @@ import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.fx.distort.FluidDistort
|
||||
import org.openrndr.extra.fx.patterns.Checkers
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val fd = FluidDistort()
|
||||
val checkers = Checkers()
|
||||
@@ -29,4 +28,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,16 @@
|
||||
import org.openrndr.extra.fx.color.RgbToOkLab
|
||||
import org.openrndr.extra.fx.color.OkLabToRgb
|
||||
import org.openrndr.application
|
||||
import org.openrndr.draw.ColorType
|
||||
import org.openrndr.draw.createEquivalent
|
||||
import org.openrndr.draw.loadImage
|
||||
import org.openrndr.extra.fx.color.OkLabToRgb
|
||||
import org.openrndr.extra.fx.color.RgbToOkLab
|
||||
|
||||
/**
|
||||
* This demonstrates converting a [ColorBuffer] from and to (OK)LAB color space using the [RgbToOkLab] and [OkLabToRgb]
|
||||
* filters. The (OK)Lab representation is signed and requires a floating point representation.
|
||||
*/
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val rgbToOkLab = RgbToOkLab()
|
||||
val okLabToRgb = OkLabToRgb()
|
||||
@@ -24,4 +23,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,7 @@ import org.openrndr.extra.fx.patterns.Checkers
|
||||
import org.openrndr.math.Vector2
|
||||
import kotlin.math.sin
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -42,4 +41,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,7 @@ import kotlin.random.Random
|
||||
* - Filters the generated points to enforce a minimum distance of 20.0 units between them.
|
||||
* - Visualizes the filtered points as circles with a radius of 10.0 units on the canvas.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -27,4 +26,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,7 @@ import kotlin.random.Random
|
||||
* - Rectangles representing the bounds of the cells in the grid.
|
||||
* - Circles representing the generated points.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -37,8 +36,6 @@ fun main() {
|
||||
drawer.fill = null
|
||||
drawer.stroke = ColorRGBa.PINK
|
||||
drawer.circles(hashGrid.points().map { it.first }.toList(), 36.0)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,7 @@ import org.openrndr.draw.loadImage
|
||||
import kotlin.math.cos
|
||||
import kotlin.math.sin
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
// Load an image, convert to BoofCV format using orx-boofcv
|
||||
val input = loadImage("demo-data/images/image-001.png").toGrayF32()
|
||||
@@ -33,10 +32,14 @@ fun main() {
|
||||
val contours = BinaryImageOps.contour(filtered, ConnectRule.EIGHT, null)
|
||||
|
||||
// orx-boofcv: convert vector data to OPENRNDR ShapeContours
|
||||
val externalShapes = contours.toShapeContours(true,
|
||||
internal = false, external = true)
|
||||
val internalShapes = contours.toShapeContours(true,
|
||||
internal = true, external = false)
|
||||
val externalShapes = contours.toShapeContours(
|
||||
true,
|
||||
internal = false, external = true
|
||||
)
|
||||
val internalShapes = contours.toShapeContours(
|
||||
true,
|
||||
internal = true, external = false
|
||||
)
|
||||
|
||||
extend {
|
||||
drawer.run {
|
||||
@@ -62,4 +65,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,9 +3,7 @@ import org.openrndr.boofcv.binding.resizeBy
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.draw.loadImage
|
||||
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
// Load an image, convert to BoofCV format using orx-boofcv
|
||||
val input = loadImage("demo-data/images/image-001.png")
|
||||
@@ -23,4 +21,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,9 +3,7 @@ import org.openrndr.boofcv.binding.resizeTo
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.draw.loadImage
|
||||
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
// Load an image, convert to BoofCV format using orx-boofcv
|
||||
val input = loadImage("demo-data/images/image-001.png")
|
||||
@@ -22,4 +20,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,8 +17,7 @@ import org.openrndr.math.Vector2
|
||||
import org.openrndr.shape.Rectangle
|
||||
import org.openrndr.shape.ShapeContour
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
// Create a buffer where to draw something for boofcv
|
||||
val rt = renderTarget(width, height) {
|
||||
@@ -30,8 +29,12 @@ fun main() {
|
||||
clear(ColorRGBa.BLACK)
|
||||
fill = ColorRGBa.WHITE
|
||||
stroke = null
|
||||
rectangle(Rectangle.fromCenter(bounds.position(0.33, 0.5),
|
||||
150.0, 150.0))
|
||||
rectangle(
|
||||
Rectangle.fromCenter(
|
||||
bounds.position(0.33, 0.5),
|
||||
150.0, 150.0
|
||||
)
|
||||
)
|
||||
translate(bounds.position(0.62, 0.5))
|
||||
rotate(30.0)
|
||||
rectangle(Rectangle.fromCenter(Vector2.ZERO, 200.0, 200.0))
|
||||
@@ -77,7 +80,6 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun imageToContours(input: ColorBuffer): List<ShapeContour> {
|
||||
val bitmap = input.toGrayF32()
|
||||
|
||||
@@ -62,7 +62,7 @@ private fun SceneRenderer.processVoxelConeTracing(drawer: Drawer, scene: Scene,
|
||||
val position = Vector3.ZERO
|
||||
drawer.lookAt(position + side.forward*40.0, position , side.up)
|
||||
drawPass(drawer, pass, materialContext, context) {
|
||||
it.parameter("voxelMap", feature.voxelMap!!.imageBinding(0, ImageAccess.WRITE))
|
||||
it.image("voxelMap", feature.voxelMap!!.imageBinding(0, ImageAccess.WRITE))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,7 @@ import org.openrndr.extra.parameters.Description
|
||||
import org.openrndr.extra.parameters.PathParameter
|
||||
import org.openrndr.extra.propertywatchers.watchingImagePath
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val gui = GUI()
|
||||
gui.compartmentsCollapsedByDefault = false
|
||||
@@ -25,4 +24,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import org.openrndr.*
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.dialogs.*
|
||||
import org.openrndr.draw.Drawer
|
||||
import org.openrndr.extra.noise.random
|
||||
import org.openrndr.extra.noise.uniform
|
||||
import org.openrndr.extra.parameters.*
|
||||
import org.openrndr.internal.Driver
|
||||
@@ -1077,7 +1076,7 @@ open class GUI(
|
||||
val min = parameter.doubleRange!!.start
|
||||
val max = parameter.doubleRange!!.endInclusive
|
||||
val currentValue = (parameter.property as KMutableProperty1<Any, Double>).get(labeledObject.obj)
|
||||
val randomValue = random(min, max)
|
||||
val randomValue = Double.uniform(min, max)
|
||||
val newValue = mix(currentValue, randomValue, strength)
|
||||
(parameter.property as KMutableProperty1<Any, Double>).set(labeledObject.obj, newValue)
|
||||
}
|
||||
@@ -1086,7 +1085,7 @@ open class GUI(
|
||||
val min = parameter.intRange!!.first
|
||||
val max = parameter.intRange!!.last
|
||||
val currentValue = (parameter.property as KMutableProperty1<Any, Int>).get(labeledObject.obj)
|
||||
val randomValue = random(min.toDouble(), max.toDouble())
|
||||
val randomValue = Double.uniform(min.toDouble(), max.toDouble())
|
||||
val newValue = mix(currentValue.toDouble(), randomValue, strength).roundToInt()
|
||||
(parameter.property as KMutableProperty1<Any, Int>).set(labeledObject.obj, newValue)
|
||||
}
|
||||
|
||||
@@ -9,8 +9,7 @@ import org.openrndr.math.Vector2
|
||||
/**
|
||||
* Demonstration of two-way binding using [bindMidiControl]
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val midi = openMidiDevice("MIDI2x2 [hw:3,0,0]")
|
||||
val settings = object {
|
||||
@@ -38,4 +37,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,7 @@ import org.openrndr.extra.midi.openMidiDevice
|
||||
/**
|
||||
* Demonstration of [MidiConsole]
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
listMidiDevices().forEach { println(it.toString()) }
|
||||
val midi = openMidiDevice("Launchpad [hw:4,0,0]")
|
||||
@@ -16,4 +15,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,7 @@ import kotlin.random.Random
|
||||
* Hold the mouse button to randomize the frequencies.
|
||||
* Press keys 'a' or 'b' for less random frequencies.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val minim = minim()
|
||||
val out = minim.lineOut
|
||||
@@ -107,4 +106,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,12 @@
|
||||
import ddf.minim.Minim
|
||||
import ddf.minim.analysis.FFT
|
||||
import ddf.minim.analysis.LanczosWindow
|
||||
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extra.minim.minim
|
||||
import org.openrndr.math.map
|
||||
import kotlin.math.ln
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 1280
|
||||
height = 720
|
||||
@@ -35,4 +33,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extra.minim.minim
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val minim = minim()
|
||||
if (minim.lineOut == null) {
|
||||
@@ -25,4 +24,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,7 @@ import kotlin.math.cos
|
||||
/**
|
||||
* Live-coding with [oliveProgram]
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 1280
|
||||
height = 720
|
||||
@@ -43,4 +42,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import org.openrndr.draw.colorBuffer
|
||||
import org.openrndr.draw.isolatedWithTarget
|
||||
import org.openrndr.draw.renderTarget
|
||||
import org.openrndr.extra.noise.Random
|
||||
import org.openrndr.extra.noise.uniform
|
||||
import org.openrndr.math.Polar
|
||||
import org.openrndr.math.clamp
|
||||
import org.openrndr.poissonfill.PoissonFill
|
||||
@@ -34,11 +35,11 @@ fun main() {
|
||||
val things = List(10) {
|
||||
Thing(
|
||||
ColorHSVa(it * 182.0,
|
||||
Random.double(0.3, 0.6),
|
||||
Random.double(0.1, 0.9)).toRGBa(),
|
||||
Polar(Random.double0(360.0),
|
||||
Double.uniform(0.3, 0.6),
|
||||
Double.uniform(0.1, 0.9)).toRGBa(),
|
||||
Polar(Double.uniform(0.0, 360.0),
|
||||
100.0 + it * 10.0),
|
||||
Polar(Random.double(-1.0, 1.0), 0.0))
|
||||
Polar(Double.uniform(-1.0, 1.0), 0.0))
|
||||
}
|
||||
val mouseTracker = MouseTracker(mouse)
|
||||
|
||||
|
||||
@@ -6,8 +6,7 @@ import org.openrndr.draw.colorBuffer
|
||||
import org.openrndr.draw.tint
|
||||
import org.openrndr.extra.realsense2.RS2Sensor
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val sensors = RS2Sensor.listSensors()
|
||||
val depthFrame = colorBuffer(640, 480, format = ColorFormat.R, type = ColorType.UINT16)
|
||||
@@ -31,4 +30,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,8 +11,7 @@ import org.openrndr.extra.realsense2.RS2Sensor
|
||||
*
|
||||
* Tested with two sensors, only uses depth stream now
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 1280
|
||||
height = 720
|
||||
@@ -42,4 +41,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
import org.openrndr.application
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,20 +6,13 @@ import org.openrndr.draw.shadeStyle
|
||||
import org.openrndr.extra.camera.Orbital
|
||||
import org.openrndr.extra.mesh.IIndexedPolygon
|
||||
import org.openrndr.extra.mesh.IVertexData
|
||||
import org.openrndr.extra.mesh.noise.nonuniform
|
||||
import org.openrndr.extra.mesh.noise.nonuniformHammersley
|
||||
import org.openrndr.extra.mesh.noise.nonuniformRSeq
|
||||
import org.openrndr.extra.objloader.loadOBJMeshData
|
||||
import org.openrndr.extra.mesh.noise.uniform
|
||||
import org.openrndr.extra.meshgenerators.normals.estimateNormals
|
||||
import org.openrndr.extra.meshgenerators.sphereMesh
|
||||
import org.openrndr.math.Spherical
|
||||
import org.openrndr.extra.objloader.loadOBJMeshData
|
||||
import org.openrndr.math.Vector3
|
||||
import java.io.File
|
||||
import kotlin.math.absoluteValue
|
||||
import kotlin.math.cos
|
||||
import kotlin.math.pow
|
||||
import kotlin.math.sin
|
||||
import kotlin.random.Random
|
||||
|
||||
|
||||
|
||||
@@ -6,8 +6,7 @@ import org.openrndr.drawImage
|
||||
import org.openrndr.extra.propertywatchers.watchingImagePath
|
||||
import org.openrndr.extra.propertywatchers.watchingProperty
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val state = object {
|
||||
var path = "demo-data/images/image-001.png"
|
||||
@@ -30,4 +29,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.extra.propertywatchers.watchingProperty
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val state = object {
|
||||
val x by watchingProperty(mouse::position) {
|
||||
@@ -19,4 +18,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,7 @@ import org.openrndr.extra.quadtree.Quadtree
|
||||
import org.openrndr.math.Vector2
|
||||
import org.openrndr.shape.Rectangle
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -45,4 +44,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,7 @@ import org.openrndr.extra.quadtree.Quadtree
|
||||
import org.openrndr.math.Vector2
|
||||
import org.openrndr.shape.Rectangle
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -72,4 +71,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,7 @@ import org.openrndr.shape.Rectangle
|
||||
* Example of 5 gradient styles.
|
||||
* NPointLinear and NPoingGradient have separate demos.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 1000
|
||||
height = 500
|
||||
@@ -47,30 +46,36 @@ fun main() {
|
||||
gradient.length = 0.6
|
||||
gradient.offset = offset
|
||||
}
|
||||
|
||||
is AngularGradient -> {
|
||||
gradient.color1 = color1
|
||||
gradient.exponent = column / 3.0 + 0.3
|
||||
gradient.rotation = (seconds - column) * 10.0
|
||||
gradient.offset = offset
|
||||
}
|
||||
|
||||
is LinearGradient -> {
|
||||
gradient.color1 = color1
|
||||
gradient.exponent = column / 3.0 + 0.3
|
||||
gradient.rotation = seconds * 10.0
|
||||
}
|
||||
|
||||
is HalfAngularGradient -> {
|
||||
gradient.color1 = color1
|
||||
gradient.exponent = column / 3.0 + 0.3
|
||||
gradient.rotation = (column - seconds) * 10.0
|
||||
gradient.offset = offset
|
||||
}
|
||||
|
||||
is NPointGradient -> {
|
||||
// Animate points.
|
||||
// We could also animate colors.
|
||||
gradient.points = Array(gradient.colors.size) {
|
||||
rect.center + Polar(it * 90.0 +
|
||||
rect.center + Polar(
|
||||
it * 90.0 +
|
||||
column * 36 - seconds * 10,
|
||||
40.0).cartesian
|
||||
40.0
|
||||
).cartesian
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,4 +87,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,7 @@ import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.extra.color.spaces.toOKLABa
|
||||
import org.openrndr.extra.shadestyles.linearGradient
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
extend {
|
||||
drawer.shadeStyle = linearGradient(
|
||||
@@ -22,4 +21,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,8 +16,7 @@ import kotlin.math.cos
|
||||
* on a static shape (a circle for example) or you can animate a shape
|
||||
* with a static gradient.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val numPoints = 8
|
||||
val gradient = NPointGradient(Array(numPoints) {
|
||||
@@ -43,4 +42,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,7 @@ import kotlin.math.sin
|
||||
* uniformly between 0.0 and 1.0 and then animated towards one of
|
||||
* the ends over time using pow() and sin(seconds).
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val numPoints = 8
|
||||
// Create gradients using two different color spaces
|
||||
@@ -63,4 +62,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,19 +11,22 @@ import kotlin.random.Random
|
||||
* Any of the properties can be animated, including colors and points.
|
||||
* See DemoNPointLinearGradient01.kt for an example of animated properties.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val gradient = NPointRadialGradient(arrayOf(
|
||||
val gradient = NPointRadialGradient(
|
||||
arrayOf(
|
||||
ColorRGBa.PINK.opacify(0.0),
|
||||
ColorRGBa.PINK, ColorRGBa.WHITE, ColorRGBa.PINK,
|
||||
ColorRGBa.PINK.opacify(0.0)
|
||||
), arrayOf(0.0, 0.4, 0.5, 0.6, 1.0))
|
||||
), arrayOf(0.0, 0.4, 0.5, 0.6, 1.0)
|
||||
)
|
||||
|
||||
val circles = List(25) {
|
||||
Circle(Random.nextDouble() * drawer.width,
|
||||
Circle(
|
||||
Random.nextDouble() * drawer.width,
|
||||
Random.nextDouble() * drawer.height,
|
||||
Random.nextDouble() * 150.0)
|
||||
Random.nextDouble() * 150.0
|
||||
)
|
||||
}
|
||||
|
||||
extend {
|
||||
@@ -37,4 +40,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,7 @@ import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.extra.shadestyles.radialGradient
|
||||
import kotlin.math.cos
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
extend {
|
||||
drawer.shadeStyle = radialGradient(
|
||||
@@ -16,4 +15,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,7 @@ import org.openrndr.shape.Circle
|
||||
import kotlin.math.cos
|
||||
import kotlin.math.sin
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -32,4 +31,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,7 @@ import org.openrndr.shape.Circle
|
||||
import kotlin.math.cos
|
||||
import kotlin.math.sin
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -31,4 +30,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,7 @@ import org.openrndr.math.Vector2
|
||||
import kotlin.math.cos
|
||||
import kotlin.math.sin
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -40,4 +39,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,7 @@ import org.openrndr.extra.shapes.adjust.adjustContour
|
||||
import org.openrndr.shape.Circle
|
||||
import kotlin.math.cos
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -28,4 +27,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,7 @@ import org.openrndr.extra.shapes.adjust.adjustContour
|
||||
import org.openrndr.shape.Circle
|
||||
import kotlin.math.cos
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -33,4 +32,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,7 @@ import org.openrndr.extra.shapes.adjust.adjustContour
|
||||
import org.openrndr.shape.Circle
|
||||
import kotlin.math.cos
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -40,4 +39,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,7 @@ import org.openrndr.math.Vector2
|
||||
import org.openrndr.shape.contour
|
||||
import kotlin.math.cos
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -39,4 +38,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
//package adjust
|
||||
package adjust
|
||||
|
||||
import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
@@ -6,8 +6,7 @@ import org.openrndr.extra.shapes.adjust.adjustContour
|
||||
import org.openrndr.math.Vector2
|
||||
import org.openrndr.shape.contour
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -48,4 +47,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,7 @@ import org.openrndr.extra.shapes.tunni.tunniLine
|
||||
import org.openrndr.extra.shapes.tunni.tunniPoint
|
||||
import kotlin.math.sqrt
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -57,4 +56,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,7 @@ import org.openrndr.math.Vector2
|
||||
import org.openrndr.shape.Segment2D
|
||||
import kotlin.math.cos
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -99,4 +98,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,7 @@ import org.openrndr.shape.Circle
|
||||
import kotlin.math.sqrt
|
||||
import kotlin.random.Random
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
val circles = listOf(
|
||||
Circle(drawer.bounds.center - Vector2(50.0, 0.0), 50.0),
|
||||
@@ -34,11 +33,13 @@ fun main() {
|
||||
for (f in arr.boundedFaces) {
|
||||
drawer.fill =
|
||||
|
||||
rgb(Double.uniform(0.0, 1.0, r), Double.uniform(0.0, 1.0, r), Double.uniform(0.0, 1.0, r)).saturate<OKHSV>(0.25)
|
||||
rgb(
|
||||
Double.uniform(0.0, 1.0, r),
|
||||
Double.uniform(0.0, 1.0, r),
|
||||
Double.uniform(0.0, 1.0, r)
|
||||
).saturate<OKHSV>(0.25)
|
||||
drawer.contour(f.contour)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,7 @@ import org.openrndr.shape.ShapeContour
|
||||
* The created contours are horizontal and vertical in "bezier-patch space" but
|
||||
* are rendered deformed following the shape of the bezier patch.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -53,4 +52,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,7 @@ import org.openrndr.shape.ShapeContour
|
||||
* but one can manually create any other 4-segment closed contour
|
||||
* to use in bezier patches.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -36,4 +35,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,7 @@ import org.openrndr.shape.ShapeContour
|
||||
* In this case the contours are regular stars and the bezier patch
|
||||
* is created using a circular contour with the required 4 segments.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -55,4 +54,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,7 @@ import org.openrndr.shape.Circle
|
||||
* You can think of bezierPatch.position() as requesting points
|
||||
* in a wavy flag (the bezier patch) using normalized uv coordinates.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -43,4 +42,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ package bezierpatch
|
||||
import org.openrndr.WindowMultisample
|
||||
import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.extra.shapes.bezierpatches.bezierPatch
|
||||
import org.openrndr.extra.camera.Orbital
|
||||
import org.openrndr.extra.shapes.bezierpatches.bezierPatch
|
||||
import org.openrndr.math.Vector3
|
||||
import org.openrndr.shape.Segment3D
|
||||
|
||||
@@ -19,8 +19,7 @@ import org.openrndr.shape.Segment3D
|
||||
* The created contours are horizontal and vertical in "bezier-patch space" but
|
||||
* are rendered deformed following the shape of the bezier patch.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -71,4 +70,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,7 @@ import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.extra.shapes.bezierpatches.bezierPatch
|
||||
import org.openrndr.shape.Circle
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.PINK)
|
||||
@@ -34,4 +33,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,7 @@ import org.openrndr.extra.color.spaces.toOKLABa
|
||||
import org.openrndr.extra.shapes.bezierpatches.bezierPatch
|
||||
import org.openrndr.shape.Circle
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -31,10 +30,30 @@ fun main() {
|
||||
Circle(width / 2.0 + 180.0, height / 2.0, 170.0).contour
|
||||
).withColors(
|
||||
listOf(
|
||||
listOf(ColorRGBa.PINK.toOKLABa(), ColorRGBa.PINK.toOKLABa(), ColorRGBa.PINK.toOKLABa(), ColorRGBa.PINK.toOKLABa()),
|
||||
listOf(ColorRGBa.RED.toOKLABa(), ColorRGBa.RED.toOKLABa(), ColorRGBa.RED.toOKLABa(), ColorRGBa.RED.toOKLABa()),
|
||||
listOf(ColorRGBa.BLUE.toOKLABa(), ColorRGBa.BLUE.toOKLABa(), ColorRGBa.BLUE.toOKLABa(), ColorRGBa.BLUE.toOKLABa()),
|
||||
listOf(ColorRGBa.WHITE.toOKLABa(), ColorRGBa.WHITE.toOKLABa(), ColorRGBa.WHITE.toOKLABa(), ColorRGBa.WHITE.toOKLABa()),
|
||||
listOf(
|
||||
ColorRGBa.PINK.toOKLABa(),
|
||||
ColorRGBa.PINK.toOKLABa(),
|
||||
ColorRGBa.PINK.toOKLABa(),
|
||||
ColorRGBa.PINK.toOKLABa()
|
||||
),
|
||||
listOf(
|
||||
ColorRGBa.RED.toOKLABa(),
|
||||
ColorRGBa.RED.toOKLABa(),
|
||||
ColorRGBa.RED.toOKLABa(),
|
||||
ColorRGBa.RED.toOKLABa()
|
||||
),
|
||||
listOf(
|
||||
ColorRGBa.BLUE.toOKLABa(),
|
||||
ColorRGBa.BLUE.toOKLABa(),
|
||||
ColorRGBa.BLUE.toOKLABa(),
|
||||
ColorRGBa.BLUE.toOKLABa()
|
||||
),
|
||||
listOf(
|
||||
ColorRGBa.WHITE.toOKLABa(),
|
||||
ColorRGBa.WHITE.toOKLABa(),
|
||||
ColorRGBa.WHITE.toOKLABa(),
|
||||
ColorRGBa.WHITE.toOKLABa()
|
||||
),
|
||||
)
|
||||
)
|
||||
drawer.bezierPatch(bp3)
|
||||
@@ -46,4 +65,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,7 @@ import org.openrndr.shape.Circle
|
||||
import org.openrndr.shape.Rectangle
|
||||
import kotlin.math.min
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -23,10 +22,30 @@ fun main() {
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.BLACK)
|
||||
val colors = listOf(
|
||||
listOf(ColorRGBa.PINK.toOKLABa(), ColorRGBa.PINK.toOKLABa(), ColorRGBa.PINK.toOKLABa(), ColorRGBa.PINK.toOKLABa()),
|
||||
listOf(ColorRGBa.RED.toOKLABa(), ColorRGBa.RED.toOKLABa(), ColorRGBa.RED.toOKLABa(), ColorRGBa.RED.toOKLABa()),
|
||||
listOf(ColorRGBa.BLUE.toOKLABa(), ColorRGBa.BLUE.toOKLABa(), ColorRGBa.BLUE.toOKLABa(), ColorRGBa.BLUE.toOKLABa()),
|
||||
listOf(ColorRGBa.WHITE.toOKLABa(), ColorRGBa.WHITE.toOKLABa(), ColorRGBa.WHITE.toOKLABa(), ColorRGBa.WHITE.toOKLABa()),
|
||||
listOf(
|
||||
ColorRGBa.PINK.toOKLABa(),
|
||||
ColorRGBa.PINK.toOKLABa(),
|
||||
ColorRGBa.PINK.toOKLABa(),
|
||||
ColorRGBa.PINK.toOKLABa()
|
||||
),
|
||||
listOf(
|
||||
ColorRGBa.RED.toOKLABa(),
|
||||
ColorRGBa.RED.toOKLABa(),
|
||||
ColorRGBa.RED.toOKLABa(),
|
||||
ColorRGBa.RED.toOKLABa()
|
||||
),
|
||||
listOf(
|
||||
ColorRGBa.BLUE.toOKLABa(),
|
||||
ColorRGBa.BLUE.toOKLABa(),
|
||||
ColorRGBa.BLUE.toOKLABa(),
|
||||
ColorRGBa.BLUE.toOKLABa()
|
||||
),
|
||||
listOf(
|
||||
ColorRGBa.WHITE.toOKLABa(),
|
||||
ColorRGBa.WHITE.toOKLABa(),
|
||||
ColorRGBa.WHITE.toOKLABa(),
|
||||
ColorRGBa.WHITE.toOKLABa()
|
||||
),
|
||||
)
|
||||
|
||||
val grid = drawer.bounds.grid(4, 4, marginX = 20.0, marginY = 20.0, gutterX = 10.0, gutterY = 10.0)
|
||||
@@ -58,4 +77,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,7 @@ import org.openrndr.shape.ShapeContour
|
||||
* but one can manually create any other 4-segment closed contour
|
||||
* to use in bezier patches.
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -34,4 +33,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,12 +10,10 @@ import org.openrndr.shape.Circle
|
||||
import kotlin.math.PI
|
||||
import kotlin.math.cos
|
||||
|
||||
|
||||
/**
|
||||
* Demonstration of uniform contour blending
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -34,4 +32,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,8 +14,7 @@ import kotlin.math.cos
|
||||
/**
|
||||
* Demonstration of non-uniform contour blending
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -36,4 +35,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,7 @@ import org.openrndr.math.Vector3
|
||||
import org.openrndr.shape.path3D
|
||||
import kotlin.random.Random
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -60,8 +59,6 @@ fun main() {
|
||||
drawer.vertexBuffer(cylinder, DrawPrimitive.TRIANGLES)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,7 @@ import org.openrndr.extra.noise.uniform
|
||||
import org.openrndr.extra.shapes.ordering.hilbertOrder
|
||||
import kotlin.random.Random
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -22,4 +21,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,11 +4,9 @@ import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.extra.noise.uniform
|
||||
import org.openrndr.extra.shapes.ordering.hilbertOrder
|
||||
import org.openrndr.extra.shapes.ordering.mortonOrder
|
||||
import kotlin.random.Random
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -26,4 +24,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,25 +4,19 @@ import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.draw.LineJoin
|
||||
import org.openrndr.extra.camera.Orbital
|
||||
import org.openrndr.extra.noise.uniformRing
|
||||
import org.openrndr.extra.shapes.path3d.projectToContour
|
||||
import org.openrndr.math.Spherical
|
||||
import org.openrndr.math.Vector3
|
||||
import org.openrndr.shape.path3D
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
}
|
||||
fun main() = application {
|
||||
program {
|
||||
val path = path3D {
|
||||
var p = Vector3(1.0, 0.0, 0.0)
|
||||
moveTo(p * 6.0)
|
||||
for (i in 0 until 400) {
|
||||
p += Vector3.uniformRing(0.2, 0.5)
|
||||
p = p.normalized
|
||||
arcTo(5.0, cursor.atan2(p * 6.0), false, false, p * 6.0)
|
||||
var p = Vector3(6.0, 0.0, 0.0)
|
||||
moveTo(p)
|
||||
for (i in 0 until 100) {
|
||||
p = Spherical((i % 6) * 45.0, (i % 4 + 1) * 30.0 + i * 0.1, 6.0).cartesian
|
||||
arcTo(5.0, cursor.atan2(p), false, false, p)
|
||||
}
|
||||
}
|
||||
extend(Orbital())
|
||||
@@ -38,4 +32,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,7 @@ import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.extra.shapes.primitives.Arc
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -21,4 +20,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,7 @@ import org.openrndr.extra.shapes.primitives.Net
|
||||
import org.openrndr.shape.Circle
|
||||
import kotlin.math.sin
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
program {
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.BLACK)
|
||||
@@ -31,4 +30,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,7 @@ import org.openrndr.extra.shapes.primitives.Pulley
|
||||
import org.openrndr.math.Vector2
|
||||
import org.openrndr.shape.Circle
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -25,4 +24,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,7 @@ import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.extra.shapes.primitives.grid
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 800
|
||||
height = 800
|
||||
@@ -25,4 +24,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,7 @@ import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.extra.noise.Random
|
||||
import org.openrndr.extra.shapes.primitives.grid
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
// Try changing the resolution. The design will use the available space.
|
||||
configure {
|
||||
width = 800
|
||||
@@ -16,8 +15,10 @@ fun main() {
|
||||
// By specifying the cell size we make sure the design will
|
||||
// contain squares, independently of the window size and its
|
||||
// aspect ratio.
|
||||
val grid = drawer.bounds.grid(50.0, 50.0,
|
||||
20.0, 20.0, 20.0, 20.0).flatten()
|
||||
val grid = drawer.bounds.grid(
|
||||
50.0, 50.0,
|
||||
20.0, 20.0, 20.0, 20.0
|
||||
).flatten()
|
||||
|
||||
val grid2 = grid.map { rect ->
|
||||
// Each of these inner grids will occupy the available space
|
||||
@@ -36,4 +37,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,7 @@ import org.openrndr.extra.shapes.primitives.intersection
|
||||
* Demonstrate rectangle-rectangle intersection
|
||||
* @see <img src="https://raw.githubusercontent.com/openrndr/orx/media/orx-shapes/images/primitives-DemoRectangleIntersection01Kt.png">
|
||||
*/
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -37,4 +36,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,7 @@ import org.openrndr.math.Vector2
|
||||
import org.openrndr.shape.Circle
|
||||
import kotlin.random.Random
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -28,4 +27,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,7 @@ import org.openrndr.extra.shapes.hobbycurve.hobbyCurve
|
||||
import org.openrndr.extra.shapes.rectify.rectified
|
||||
import kotlin.random.Random
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -29,4 +28,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,7 @@ import org.openrndr.extra.shapes.hobbycurve.hobbyCurve
|
||||
import org.openrndr.extra.shapes.rectify.rectified
|
||||
import kotlin.random.Random
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -32,4 +31,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,7 @@ import org.openrndr.extra.shapes.hobbycurve.hobbyCurve
|
||||
import org.openrndr.extra.shapes.rectify.rectified
|
||||
import kotlin.random.Random
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -31,4 +30,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,7 @@ import org.openrndr.extra.shapes.rectify.rectified
|
||||
import org.openrndr.math.Vector3
|
||||
import org.openrndr.shape.path3D
|
||||
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -46,4 +44,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,7 @@ import org.openrndr.draw.font.loadFace
|
||||
import org.openrndr.extra.shapes.bounds.bounds
|
||||
import org.openrndr.extra.shapes.text.shapesFromText
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
height = 720
|
||||
@@ -28,4 +26,3 @@ fun main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user