Fixes and move to jvmDemo (#286)
This commit is contained in:
31
orx-fx/src/jvmDemo/kotlin/DemoFluidDistort01.kt
Normal file
31
orx-fx/src/jvmDemo/kotlin/DemoFluidDistort01.kt
Normal file
@@ -0,0 +1,31 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.draw.colorBuffer
|
||||
import org.openrndr.draw.createEquivalent
|
||||
import org.openrndr.extensions.SingleScreenshot
|
||||
import org.openrndr.extra.fx.distort.FluidDistort
|
||||
import org.openrndr.extra.fx.patterns.Checkers
|
||||
|
||||
fun main() {
|
||||
application {
|
||||
program {
|
||||
val fd = FluidDistort()
|
||||
val checkers = Checkers()
|
||||
|
||||
val image = colorBuffer(width, height)
|
||||
val distorted = image.createEquivalent()
|
||||
checkers.size = 64.0
|
||||
checkers.apply(emptyArray(), image)
|
||||
|
||||
if (System.getProperty("takeScreenshot") == "true") {
|
||||
extend(SingleScreenshot()) {
|
||||
this.outputFile = System.getProperty("screenshotPath")
|
||||
}
|
||||
}
|
||||
extend {
|
||||
fd.blend = mouse.position.x/width
|
||||
fd.apply(image, distorted)
|
||||
drawer.image(distorted)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user