<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/PerspectiveCameraComponent",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation26PerspectiveCameraComponentV"
  },
  "title" : "PerspectiveCameraComponent"
}
-->

# PerspectiveCameraComponent

A component that defines a virtual camera and its controls.

```
struct PerspectiveCameraComponent
```

## Overview

Each scene requires a camera that defines the viewpoint from
which RealityKit renders the scene.
In RealityKit, the default camera is a *perspective camera*,
which simulates the way real cameras and human vision work.
Entities that are farther away from the camera render smaller.

For an alternative camera solution, see [`OrthographicCameraComponent`](/documentation/RealityKit/OrthographicCameraComponent).

To create a perspective camera, add this component to an entity.

```swift
let cameraEntity = Entity()

// Place the camera 2 meters along the z-axis,
// looking at the scene origin.
let cameraPosition: SIMD3<Float> = [0, 0, 2]
cameraEntity.look(at: .zero, from: cameraPosition, relativeTo: nil)

cameraEntity.components.set(PerspectiveCameraComponent())
```

A `PerspectiveCameraComponent` defines the camera settings for a
perspective camera, such as the [`fieldOfViewInDegrees`](/documentation/RealityKit/PerspectiveCameraComponent/fieldOfViewInDegrees).
The entity’s [`transform`](/documentation/RealityKit/HasTransform/transform) defines the camera entity’s viewpoint and direction.
The direction it points is along the entity’s negative z-axis.

In AR scenarios, the system provides the camera automatically;
however, in non-AR scenarios, the app needs to set the camera.
If the app doesn’t provide a camera, the system uses the default perspective camera.

## Topics

### Creating a camera component

[`init(near:far:fieldOfViewInDegrees:)`](/documentation/RealityKit/PerspectiveCameraComponent/init(near:far:fieldOfViewInDegrees:))

Creates a perspective camera component from near and far clipping planes and a field of view.

[`init(near:far:fieldOfViewInDegrees:fieldOfViewOrientation:)`](/documentation/RealityKit/PerspectiveCameraComponent/init(near:far:fieldOfViewInDegrees:fieldOfViewOrientation:))

Creates a perspective camera component from near and far clipping planes,
a field of view, and an orientation.

### Setting focal points

[`far`](/documentation/RealityKit/PerspectiveCameraComponent/far)

The maximum distance in meters from the camera that the camera can see.

[`near`](/documentation/RealityKit/PerspectiveCameraComponent/near)

The minimum distance in meters from the camera that the camera can see.

### Setting the field of view

[`fieldOfViewInDegrees`](/documentation/RealityKit/PerspectiveCameraComponent/fieldOfViewInDegrees)

The camera’s total field of view in degrees.

[`fieldOfViewOrientation`](/documentation/RealityKit/PerspectiveCameraComponent/fieldOfViewOrientation)

The orientation with which the system uses to apply the field-of-view degrees.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)