[orx-camera] add defaults() to Camera2D and OrbitalCamera.

Add DemoCamera2DManual01.kt
This commit is contained in:
Abe Pazos
2025-08-08 12:50:18 +02:00
parent 7b101297c8
commit d9e50d46de
6 changed files with 111 additions and 18 deletions

View File

@@ -1,26 +1,17 @@
import org.openrndr.PresentationMode
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.isolatedWithTarget
import org.openrndr.draw.loadFont
import org.openrndr.draw.renderTarget
import org.openrndr.extra.camera.Camera2D
import org.openrndr.extra.camera.Camera2DManual
import org.openrndr.math.Vector2
import org.openrndr.math.transforms.transform
import org.openrndr.shape.Rectangle
import kotlin.math.sin
/**
* Demonstrate the use of `Camera2DManual` for manual camera control.
*
* The application is configured with a 720x720 window size. Within the program, a custom camera (`Camera2DManual`)
* is initialized and used to create isolated drawing scopes. The `isolated` method is utilized to overlay different
* is initialized and used to create isolated drawing scopes. The `isolated` method is used to overlay different
* drawing operations while maintaining individual camera states, ensuring proper transformations for specific elements.
*
* A pink circle is drawn at the center of the canvas with varying radii using isolated and non-isolated camera states.
* The outermost and innermost circles are affected by the `Camera2DManual` isolated scope, while the middle circle
* is outside of the camera's isolated scope, creating a layered visual effect.
* Three circles are drawn on the canvas: a small pink one, a medium white one and a large pink one.
* Only the pink ones are affected by the interactive `Camera2DManual`, while the middle white circle is outside
* the camera's isolated scope.
*/
fun main() = application {
configure {