---
title: "viewMatrix(for:)"
framework: arkit
role: symbol
role_heading: Instance Method
path: "arkit/arcamera/viewmatrix(for:)"
---

# viewMatrix(for:)

Returns a transform matrix for converting from world space to camera space.

## Declaration

```swift
func viewMatrix(for orientation: UIInterfaceOrientation) -> simd_float4x4
```

## Parameters

- `orientation`: The orientation in which the camera image is to be presented.

## Return Value

Return Value A view matrix appropriate for the camera with the specified orientation.

## Discussion

Discussion This method has no effect on ARKit. Instead, this method uses the orientation parameter and the camera’s state to construct a view matrix for your own rendering code.

## See Also

### Applying Camera Geometry

- [projectionMatrix](arkit/arcamera/projectionmatrix.md)
- [projectionMatrix(for:viewportSize:zNear:zFar:)](arkit/arcamera/projectionmatrix(for:viewportsize:znear:zfar:).md)
- [projectPoint(_:orientation:viewportSize:)](arkit/arcamera/projectpoint(_:orientation:viewportsize:).md)
- [unprojectPoint(_:ontoPlane:orientation:viewportSize:)](arkit/arcamera/unprojectpoint(_:ontoplane:orientation:viewportsize:).md)
