Upgrade to OPENRNDR 0.4 snapshot
This commit is contained in:
21
orx-jvm/orx-syphon/src/test/kotlin/ClientExample.kt
Normal file
21
orx-jvm/orx-syphon/src/test/kotlin/ClientExample.kt
Normal file
@@ -0,0 +1,21 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.extra.syphon.SyphonClient
|
||||
|
||||
|
||||
suspend fun main() = application {
|
||||
configure {
|
||||
width = 1000
|
||||
height = 800
|
||||
}
|
||||
|
||||
program {
|
||||
val syphonClient = SyphonClient()
|
||||
|
||||
extend(syphonClient)
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.BLACK)
|
||||
drawer.image(syphonClient.buffer)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.extra.syphon.SyphonClient
|
||||
|
||||
/**
|
||||
* This example uses After Effects and OPENRNDR connected via Syphon
|
||||
*/
|
||||
suspend fun main() = application {
|
||||
configure {
|
||||
// The maximum resolution supported by the free
|
||||
// version of AESyphon
|
||||
width = 1024
|
||||
height = 768
|
||||
}
|
||||
|
||||
program {
|
||||
val syphonClient = SyphonClient("Adobe After Effects", "Live Preview")
|
||||
|
||||
extend(syphonClient)
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.BLACK)
|
||||
drawer.image(syphonClient.buffer)
|
||||
}
|
||||
}
|
||||
}
|
||||
22
orx-jvm/orx-syphon/src/test/kotlin/ServerExample.kt
Normal file
22
orx-jvm/orx-syphon/src/test/kotlin/ServerExample.kt
Normal file
@@ -0,0 +1,22 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.extra.syphon.SyphonServer
|
||||
import kotlin.math.*
|
||||
|
||||
|
||||
suspend fun main() = application {
|
||||
configure {
|
||||
width = 1000
|
||||
height = 1000
|
||||
}
|
||||
|
||||
program {
|
||||
extend(SyphonServer("Test"))
|
||||
|
||||
extend {
|
||||
drawer.clear(ColorRGBa.PINK)
|
||||
drawer.fill = ColorRGBa.WHITE
|
||||
drawer.circle(drawer.bounds.center, abs(cos(seconds)) * height * 0.5)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.draw.isolatedWithTarget
|
||||
import org.openrndr.draw.renderTarget
|
||||
import org.openrndr.extra.syphon.SyphonServer
|
||||
import kotlin.math.*
|
||||
|
||||
suspend fun main() = application {
|
||||
configure {
|
||||
width = 1000
|
||||
height = 1000
|
||||
}
|
||||
|
||||
program {
|
||||
val rt = renderTarget(100, 100) {
|
||||
colorBuffer()
|
||||
}
|
||||
|
||||
// You can give the server a different name
|
||||
extend(SyphonServer("Test", rt))
|
||||
|
||||
extend {
|
||||
/**
|
||||
* This is what will be sent to Syphon, and drawn in a small corner of the screen
|
||||
*/
|
||||
drawer.isolatedWithTarget(rt) {
|
||||
drawer.clear(ColorRGBa(sin(seconds), cos(seconds / 2.0), 0.5, 1.0))
|
||||
}
|
||||
|
||||
drawer.clear(ColorRGBa.PINK)
|
||||
drawer.fill = ColorRGBa.WHITE
|
||||
drawer.circle(drawer.bounds.center, abs(cos(seconds)) * height * 0.5)
|
||||
drawer.image(rt.colorBuffer(0))
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user