[orx-camera] Improve demo descriptions, add demo

This commit is contained in:
Abe Pazos
2025-10-14 15:06:34 +02:00
parent f2c1465b57
commit fe13d2ec00
7 changed files with 69 additions and 14 deletions

View File

@@ -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
}
}
}
}