Class

MDLCamera

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

Declaration

@interface MDLCamera : MDLObject

Overview

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

Topics

Managing Camera Position and Orientation

- frameBoundingBox:setNearAndFar:

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

- lookAt:

Orients the camera to face toward the specified point.

- lookAt:from:

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

Managing Camera Perspective

projectionMatrix

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

projection

The style of projection transform used by the camera.

MDLCameraProjection

Options for camera projection styles, used by the projection property.

nearVisibilityDistance

The camera's near depth limit.

farVisibilityDistance

The camera’s far depth limit.

fieldOfView

The camera’s field of view, in degrees.

- rayTo:forViewPort:

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

worldToMetersConversionScale

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

Modeling a Physical Lens

barrelDistortion

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

fisheyeDistortion

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

opticalVignetting

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

chromaticAberration

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

focalLength

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

fStop

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

apertureBladeCount

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

- bokehKernelWithSize:

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

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

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

shutterOpenInterval

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

Modeling a Physical Imaging Surface

sensorVerticalAperture

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

sensorAspect

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

sensorEnlargement

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

sensorShift

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

flash

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

exposure

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

exposureCompression

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

Importing Camera Objects from SceneKit

+ cameraWithSCNCamera:

Creates a camera object from the specified SceneKit camera object.

Relationships

Inherits From

See Also

Cameras

MDLStereoscopicCamera

A point of view for rendering a stereoscopic display of a 3D scene.