<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DeveloperToolsSupport",
  "identifier" : "/documentation/DeveloperToolsSupport/PreviewCamera/init(lookingAt:from:name:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "DeveloperToolsSupport"
    ],
    "preciseIdentifier" : "s:21DeveloperToolsSupport13PreviewCameraV7SwiftUIE9lookingAt4from4nameACSo9SPPoint3Da_AISSSgtcfc"
  },
  "title" : "init(lookingAt:from:name:)"
}
-->

# init(lookingAt:from:name:)

Creates a camera that looks towards a specified point in the preview
from a different specified point.

```
init(lookingAt position: Point3D, from: Point3D, name: String? = nil)
```

## Parameters

`position`

The point to aim the camera at, specified in meters from
the preview center.

`from`

The position of the camera, specified in meters from the
preview center.

`name`

An optional name that the canvas uses to label the camera.

## Discussion

Use one or more cameras with one of the preview macros that takes a
`cameras` input — like
<doc://com.apple.documentation/documentation/SwiftUI/Preview(_:traits:body:cameras:)>
— to create custom viewpoints for the preview. The canvas offers
custom cameras in its camera picker along with a set of standard
cameras.

---

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)