# Camera 3D

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

```
component engine.Camera3D
```

Renders a perspective view looking down the node -Z axis.

## From a script

Widen the field of view while sprinting.

```aes check
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))
    }
}
```

## Fields

| Name | Script name | Type | Default | Description |
|---|---|---|---|---|
| Fov | `Fov` | `float` | `60` | Vertical field of view in degrees. |
| Near | `Near` | `float` | `0.1` | Distance to the near clipping plane. |
| Far | `Far` | `float` | `1000` | Distance to the far clipping plane. |
| Viewport | `Viewport` | `Rect` | `(0, 0, 1, 1)` | Part of the screen the camera draws into, in normalized coordinates. |
| Mask | `Mask` | `int` | `-1` | Visibility layers this camera renders. -1 renders every layer. |
| Order | `Order` | `int` | `0` | Cameras with a lower order render first. |
| Clear | `Clear` | `bool` | `true` | Clears the viewport before drawing. |
| Clear Color | `ClearColor` | `Color` | `rgba(0.04, 0.05, 0.07, 1)` | Background color used when clear is on. |
| Active | `Active` | `bool` | `true` | Only active cameras render. |
| Orthographic | `Orthographic` | `bool` | `false` | Projects without perspective; sprites and meshes keep their size at any depth. |
| Ortho Size | `OrthoSize` | `float` | `5` | Half of the vertical extent in world units when orthographic is on. |
