<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLCamera",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLCamera"
  },
  "title" : "MDLCamera"
}
-->

# MDLCamera

A point of view for rendering a 3D scene, along with a set of parameters describing an intended appearance for rendering.

```
class MDLCamera
```

## Overview

Camera parameters include basic information—such as the [`projectionMatrix`](/documentation/ModelIO/MDLCamera/projectionMatrix) and [`fieldOfView`](/documentation/ModelIO/MDLCamera/fieldOfView) properties—for use with any renderer, as well as attributes that model real-world cameras—such as the [`fStop`](/documentation/ModelIO/MDLCamera/fStop) and [`exposure`](/documentation/ModelIO/MDLCamera/exposure) properties—for use in a renderer based on realistic optical physics.

## Topics

### Managing Camera Position and Orientation

[`-  frameBoundingBox:setNearAndFar:`](/documentation/ModelIO/MDLCamera/frameBoundingBox(_:setNearAndFar:))

Moves the camera such that the specified bounding box lies entirely within the camera’s field of view.

[`-  lookAt:`](/documentation/ModelIO/MDLCamera/look(at:))

Orients the camera to face toward the specified point.

[`-  lookAt:from:`](/documentation/ModelIO/MDLCamera/look(at:from:))

Sets the camera’s position and orients the camera to face toward the specified point.

### Managing Camera Perspective

[`projectionMatrix`](/documentation/ModelIO/MDLCamera/projectionMatrix)

A transformation matrix that determines the extent of a scene visible to the camera.

[`projection`](/documentation/ModelIO/MDLCamera/projection)

The style of projection transform used by the camera.

[`MDLCameraProjection`](/documentation/ModelIO/MDLCameraProjection)

Options for camera projection styles, used by the [`projection`](/documentation/ModelIO/MDLCamera/projection) property.

[`nearVisibilityDistance`](/documentation/ModelIO/MDLCamera/nearVisibilityDistance)

The camera’s near depth limit.

[`farVisibilityDistance`](/documentation/ModelIO/MDLCamera/farVisibilityDistance)

The camera’s far depth limit.

[`fieldOfView`](/documentation/ModelIO/MDLCamera/fieldOfView)

The camera’s field of view, in degrees.

[`-  rayTo:forViewPort:`](/documentation/ModelIO/MDLCamera/ray(to:forViewPort:))

Returns a point, in 3D world coordinates, corresponding to the specified 2D view coordinates.

[`worldToMetersConversionScale`](/documentation/ModelIO/MDLCamera/worldToMetersConversionScale)

The scale factor to meters from the world coordinate system containing the camera.

### Modeling a Physical Lens

[`barrelDistortion`](/documentation/ModelIO/MDLCamera/barrelDistortion)

The first coefficient for determining the radial distortion applied to pixels rendered using the camera.

[`fisheyeDistortion`](/documentation/ModelIO/MDLCamera/fisheyeDistortion)

The second coefficient for determining the radial distortion applied to pixels rendered using the camera.

[`opticalVignetting`](/documentation/ModelIO/MDLCamera/opticalVignetting)

The amount of radial light attenuation around the edges of an image rendered using the camera.

[`chromaticAberration`](/documentation/ModelIO/MDLCamera/chromaticAberration)

The amount of radial color shift around the edges of an image rendered using the camera.

[`focalLength`](/documentation/ModelIO/MDLCamera/focalLength)

The focal length, in millimeters, of the camera’s simulated lens.

[`fStop`](/documentation/ModelIO/MDLCamera/fStop)

The relative aperture ratio of the camera’s simulated lens.

[`apertureBladeCount`](/documentation/ModelIO/MDLCamera/apertureBladeCount)

The number of blades in the camera’s simulated aperture.

[`-  bokehKernelWithSize:`](/documentation/ModelIO/MDLCamera/bokehKernel(withSize:))

Creates and returns a texture, based on the camera’s aperture blade count, to be used in rendering out-of-focus highlights in a scene.

[`maximumCircleOfConfusion`](/documentation/ModelIO/MDLCamera/maximumCircleOfConfusion)

The maximum diameter, in millimeters on the imaging plane, at which light from a point source should appear in an image rendered using the camera.

[`focusDistance`](/documentation/ModelIO/MDLCamera/focusDistance)

The distance, in meters, at which the lens is focused.

[`shutterOpenInterval`](/documentation/ModelIO/MDLCamera/shutterOpenInterval)

The duration, in seconds, for which the camera’s simulated shutter is open during each frame.

### Modeling a Physical Imaging Surface

[`sensorVerticalAperture`](/documentation/ModelIO/MDLCamera/sensorVerticalAperture)

The height, in millimeters, of the camera’s simulated imaging surface.

[`sensorAspect`](/documentation/ModelIO/MDLCamera/sensorAspect)

The ratio of width to height for the camera’s simulated imaging surface.

[`sensorEnlargement`](/documentation/ModelIO/MDLCamera/sensorEnlargement)

The horizontal and vertical scale factors that determine the active region of the sensor.

[`sensorShift`](/documentation/ModelIO/MDLCamera/sensorShift)

The horizontal and vertical offsets, in millimeters, of the center of the camera image relative to the center of the simulated lens.

[`flash`](/documentation/ModelIO/MDLCamera/flash)

Red, green, and blue factors to be used in brightening darker areas of the camera’s image.

[`exposure`](/documentation/ModelIO/MDLCamera/exposure)

Red, green, and blue factors that scale each color channel in the camera’s image.

[`exposureCompression`](/documentation/ModelIO/MDLCamera/exposureCompression)

Two parameters that determine the brightness compression curve for colors in the camera’s image.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`MDLNamed`](/documentation/ModelIO/MDLNamed)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Equatable`](/documentation/Swift/Equatable)

### Inherited By

[`MDLStereoscopicCamera`](/documentation/ModelIO/MDLStereoscopicCamera)

### Inherits From

[`MDLObject`](/documentation/ModelIO/MDLObject)

---

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)