Camera Controller
If Camera learned earlier is the 'eye', Controller is the 'joystick' that moves that eye. It is an Interaction Module that detects user input (mouse, touch, keyboard) to control the camera's position and rotation in real time, enabling intuitive 3D navigation without complex matrix calculations.
1. Architecture and Role
RedGPU provides four standard controllers (AController) tailored to different interaction scenarios:
| Class | Control Method | Primary Use Case |
|---|---|---|
OrbitController | Left-Click: Rotate / Wheel: Zoom | 360-degree product viewers, character inspection, target-centered exploration |
FollowController | Automatic target mesh tracking (smooth interpolation) | Third-person (TPS) games, moving character tracking cameras |
FreeController | W, A, S, D: Move / Mouse: Look around | First-person (FPS) viewpoints, architectural interior tours, world debugging |
IsometricController | Maintains a fixed isometric angle | Real-time strategy (RTS) games, isometric views |
[Camera Instance Management]
Every controller class automatically creates and owns a dedicated internal Camera instance. Therefore, when using a controller, you do not need to create a separate camera—simply pass the controller directly to the camera parameter of new RedGPU.Display.View3D(redGPUContext, scene, controller).
2. Try Out Controller Samples
Experience the live behavior of each controller directly in the interactive previews below.
OrbitController
Optimized for rotating around and inspecting a specific target.
FreeController
Freely explore 3D space from a first-person perspective using the W, A, S, D keys and mouse.
IsometricController
Maintains a fixed viewing angle suitable for strategy simulations or infographics.
FollowController
Provides a viewpoint that smoothly follows characters or moving objects.
Related Examples
Next Steps
Now that you have learned how to set up viewports and control camera viewpoints, the next Basic Objects section covers how to create and manipulate 3D objects using Mesh (combining geometry and materials), hierarchical Group3D structures, and image Texture mapping.
- Basic Objects Overview: Composing 3D objects using
Mesh,Scene Graph, andTexture