---
title: viewpoint
framework: ComputeGraph
role: symbol
role_heading: Function
path: computegraph/viewpoint-swift.func
---

# viewpoint

Returns the current viewpoint, if one is provided.

## Declaration

```swift
Viewpoint viewpoint()
```

## Discussion

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. note:  note: Reads from shared uniform Viewpoint

## See Also

### Utility nodes

- [graph](computegraph/graph.md)
- [group](computegraph/group.md)
- [texture](computegraph/texture.md)
- [random](computegraph/random.md)
- [matrix4x4f](computegraph/matrix4x4f.md)
- [matrix4x4h](computegraph/matrix4x4h.md)
- [element_integrate](computegraph/element_integrate.md)
- [texture_sample](computegraph/texture_sample.md)
- [texture_sample1d](computegraph/texture_sample1d.md)
- [orient_to_velocity](computegraph/orient_to_velocity.md)
- [gridDebugCells](computegraph/griddebugcells.md)
- [gridFromPoints](computegraph/gridfrompoints.md)
- [spawn_demo](computegraph/spawn_demo.md)
