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

# OrthographicCameraComponent

A component that defines an orthographic virtual camera and its settings.

```
struct OrthographicCameraComponent
```

## Overview

Each scene requires a camera that defines the viewpoint from which RealityKit renders the scene.
The orthographic camera renders the entities in the scene without the perspective of depth,
meaning faraway objects don’t look smaller.

To create an orthographic camera, add this component to an entity.

|**Perspective camera**                                                                                                                                                                  |**Orthographic camera**                                                                                                                                                                 |
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|![An illustration of three cubes, one behind the other, rendered with a perspective camera. The cube farthest away appears smaller than the closest one.](orthocamera-perspective-cubes)|![A screenshot of three cubes, one behind the other, rendered with a orthographic camera. The cubes appear the same size, regardless of their distance.](orthocamera-orthographic-cubes)|

You can add an `OrthographicCameraComponent` to an entity’s component set, and orient that
entity so that it looks at a specific target using `Entity/look(at:from:upVector:relativeTo:)`.

```swift
// Create an entity to hold the camera component.
let cameraEntity = Entity()

// Create an orthographic camera component and add it to the camera entity.
cameraEntity.components.set(OrthographicCameraComponent())

// Set the entity's position and orientation to look at the subject.
let cameraPosition: SIMD3<Float> = [0, 1, 3]

// The subject in this case is the origin.
let target: SIMD3<Float> = .zero
cameraEntity.look(at: target, from: cameraPosition, relativeTo: nil)

// Add the camera entity to your scene.
content.add(cameraEntity)
```

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()`](/documentation/RealityKit/OrthographicCameraComponent/init())

Creates an orthographic camera component with default values.

### Setting focal points

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

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

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

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

### Setting the camera scale

[`scale`](/documentation/RealityKit/OrthographicCameraComponent/scale)

A floating-point value the camera uses to scale entities.

[`scaleDirection`](/documentation/RealityKit/OrthographicCameraComponent/scaleDirection)

The direction in which the camera applies scaling.



---

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)