Camera 3D
Renders a perspective view looking down the node -Z axis.
component engine.Camera3D
On this page
Usage
Add it with Create → Camera → Camera.
Try it
Camera 3D field of view
The camera looks at three meshes. A narrower field of view changes their apparent size and framing.
Change FOV from 70 to 40 degrees and watch the Game View; Reset restores the original view.
Scene5 nodes
Fields
| Name | Type | Default | Description |
|---|---|---|---|
| Fov | float | 60 | Vertical field of view in degrees. 1 – 179 deg |
| Near | float | 0.1 | Distance to the near clipping plane. ≥ 0.001 |
| Far | float | 1000 | Distance to the far clipping plane. ≥ 0.01 |
| Viewport | Rect | (0, 0, 1, 1) | Part of the screen the camera draws into, in normalized coordinates. |
| Mask | int | -1 | Visibility layers this camera renders. -1 renders every layer. |
| Order | int | 0 | Cameras with a lower order render first. |
| Clear | bool | true | Clears the viewport before drawing. |
| Clear Color | Color | rgba(0.04, 0.05, 0.07, 1) | Background color used when clear is on. |
| Active | bool | true | Only active cameras render. |
| Orthographic | bool | false | Projects without perspective; sprites and meshes keep their size at any depth. |
| Ortho Size | float | 5 | Half of the vertical extent in world units when orthographic is on. ≥ 0.01 |
From a script
Widen the field of view while sprinting.
package game
import "aego/math"
script SprintFov {
var Walk float = 60
var Sprint float = 75
var Sprinting bool
func Update(dt float) {
cam := node.Get<Camera3D>()
target := Walk
if Sprinting {
target = Sprint
}
cam.Fov = math.Lerp(cam.Fov, target, math.Clamp(dt*4, 0, 1))
}
}