<!--
{
  "availability" : [
    "Reality Composer Pro: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "ComputeGraph",
  "identifier" : "/documentation/ComputeGraph/viewpoint-swift.func",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Compute Graph"
    ],
    "preciseIdentifier" : "viewpoint"
  },
  "title" : "viewpoint"
}
-->

# viewpoint

Returns the current viewpoint, if one is provided.

```
Viewpoint viewpoint()
```

## Discussion

Depending on context, this may include direction, position, or
both values. On visionOS, a `ParticleViewpoint` component needs to be
added to the scene to automatically provide this value.

> Visual: ![Graph](viewpoint)

> Note: Reads from shared uniform Viewpoint

---

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)