[orx-camera] Improve demo descriptions, add demo
This commit is contained in:
@@ -10,6 +10,11 @@ import org.openrndr.extra.meshgenerators.boxMesh
|
||||
import org.openrndr.extra.meshgenerators.sphereMesh
|
||||
import org.openrndr.math.Vector3
|
||||
|
||||
/**
|
||||
* Demonstrate the use of `OrbitalCamera`, `OrbitalControls`, `AxisHelper` and `GridHelper`.
|
||||
*
|
||||
* Press the `t` key to toggle camera interaction, or `r` to reset the camera to its defaults.
|
||||
*/
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 720
|
||||
@@ -38,9 +43,6 @@ fun main() = application {
|
||||
extend(controls)
|
||||
|
||||
extend {
|
||||
// mouse and keyboard input can be toggled on and off
|
||||
controls.userInteraction = true
|
||||
|
||||
drawer.vertexBuffer(sphere, DrawPrimitive.LINE_LOOP)
|
||||
drawer.vertexBuffer(cube, DrawPrimitive.LINE_LOOP)
|
||||
|
||||
@@ -58,6 +60,10 @@ fun main() = application {
|
||||
if (it.name == "r") {
|
||||
camera.defaults()
|
||||
}
|
||||
if (it.name == "t") {
|
||||
// mouse and keyboard input can be toggled on and off
|
||||
controls.userInteraction = !controls.userInteraction
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user