---
title: "convert(transform:from:to:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/realitycoordinatespaceconverting/convert(transform:from:to:)"
---

# convert(transform:from:to:)

Returns an AffineTransform3D converted from a RealityKit coordinate space to a defined SwiftUI coordinate space.

## Declaration

```swift
func convert(transform: Transform, from realitySpace: some RealityCoordinateSpace, to space: some CoordinateSpaceProtocol) -> AffineTransform3D
```

## Discussion

Discussion This function performs a change-of-basis operation, so the returned AffineTransform3D performs the same transformation in space that the specified Transform performs in realitySpace.
