<!--
{
  "availability" : [
    "Reality Composer Pro: -",
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "ComputeGraph",
  "identifier" : "/documentation/ComputeGraph/Viewpoint-swift.struct",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Compute Graph"
    ],
    "preciseIdentifier" : "c:@S@Viewpoint"
  },
  "title" : "Viewpoint"
}
-->

# Viewpoint

Camera viewpoint parameters in 3D space.

```
struct Viewpoint
```

## Overview

This structure represents a camera or observer’s position and viewing direction,
with optional availability flags for each component. This allows partial viewpoint
information to be represented when only position or direction is known.

## Topics

### Initializers

[`init()`](/documentation/ComputeGraph/Viewpoint-swift.struct/init())

[`init(position: simd_float3, direction: simd_float3, has_position: Bool, has_direction: Bool)`](/documentation/ComputeGraph/Viewpoint-swift.struct/init(position:direction:has_position:has_direction:))

### Instance Properties

[`var direction: simd_float3`](/documentation/ComputeGraph/Viewpoint-swift.struct/direction)

The normalized direction vector indicating where the camera is looking,
in the simulation’s coordinate system

[`var has_direction: Bool`](/documentation/ComputeGraph/Viewpoint-swift.struct/has_direction)

Indicates whether a valid direction is available.

[`var has_position: Bool`](/documentation/ComputeGraph/Viewpoint-swift.struct/has_position)

Indicates whether a valid position is available.

[`var position: simd_float3`](/documentation/ComputeGraph/Viewpoint-swift.struct/position)

The 3D position of the camera or viewpoint, in the simulation’s coordinate system.

## Relationships

### Conforms To

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

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

---

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)