---
title: ProjectiveTransformCameraComponent
framework: realitykit
role: symbol
role_heading: Structure
path: realitykit/projectivetransformcameracomponent
---

# ProjectiveTransformCameraComponent

A component that defines a virtual camera with a custom projection matrix.

## Declaration

```swift
struct ProjectiveTransformCameraComponent
```

## Overview

Overview Each scene requires a camera, which defines the viewpoint from which RealityKit renders the scene. The projective transform camera renders the entities in the scene based on a custom user defined matrix. For this component, define a matrix that is either of symmetric perspective or orthographic projection. Define symmetric perspective matrices using reverse depth i.e., a matrix with near and far reversed. To create a projective transform camera, add this component to an entity. // Create a projective transform camera component with a custom matrix. let projectiveTransform = ProjectiveTransform3DFloat(     fovY: Angle2DFloat(degrees: 90.0),     aspectRatio: 0.6,     nearZ: 0.01,     farZ: 1000.0,     reverseZ: true) var projectiveCameraComponent = ProjectiveTransformCameraComponent(projectionMatrix: projectiveTransform.matrix)

// Create an entity with the camera component. let cameraEntity = Entity(components: projectiveCameraComponent)

// Set the entity's position and orientation to look at the subject (the origin in this case). let cameraPosition: SIMD3<Float> = [0, 1, 3] let target: SIMD3<Float> = .zero cameraEntity.look(at: target, from: cameraPosition, relativeTo: nil)

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

## Topics

### Initializers

- [init(projectionMatrix:)](realitykit/projectivetransformcameracomponent/init(projectionmatrix:).md)

### Instance Properties

- [transform](realitykit/projectivetransformcameracomponent/transform.md)

## Relationships

### Conforms To

- [Component](realitykit/component.md)
- [Equatable](swift/equatable.md)

## See Also

### Cameras

- [PerspectiveCameraComponent](realitykit/perspectivecameracomponent.md)
- [OrthographicCameraComponent](realitykit/orthographiccameracomponent.md)
- [CameraFieldOfViewOrientation](realitykit/camerafieldofvieworientation.md)
- [PerspectiveCamera](realitykit/perspectivecamera.md)
