---
title: "rotation3DLayout(_:axis:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/rotation3dlayout(_:axis:)"
---

# rotation3DLayout(_:axis:)

Rotates a view with impacts to its frame in a containing layout

## Declaration

```swift
nonisolated func rotation3DLayout(_ angle: Angle, axis: (x: CGFloat, y: CGFloat, z: CGFloat)) -> some View

```

## Parameters

- `angle`: The angle by which to rotate the view and its frame.
- `axis`: The axis of rotation.

## Discussion

Discussion The following example will rotate the top plane by 45 degrees while adjusting its frame to account for this rotation. The VStack sizes to fit the rotated and standard models. VStack {     Model3D(named: "plane")         .rotation3DLayout(.degrees(45), axis: (x: 0, y: 0, z: 1))     Model3D(named: "plane") } The layout system will use a bounding box that completely contains the rotated view, meaning this modifier can change the size of the view it is applied to.

## See Also

### Rotation and transformation

- [rotationEffect(_:anchor:)](swiftui/view/rotationeffect(_:anchor:).md)
- [rotation3DEffect(_:anchor:)](swiftui/view/rotation3deffect(_:anchor:).md)
- [rotation3DEffect(_:axis:anchor:anchorZ:perspective:)](swiftui/view/rotation3deffect(_:axis:anchor:anchorz:perspective:).md)
- [rotation3DEffect(_:axis:anchor:)](swiftui/view/rotation3deffect(_:axis:anchor:).md)
- [rotation3DLayout(_:)](swiftui/view/rotation3dlayout(_:).md)
- [perspectiveRotationEffect(_:axis:anchor:anchorZ:perspective:)](swiftui/view/perspectiverotationeffect(_:axis:anchor:anchorz:perspective:).md)
- [projectionEffect(_:)](swiftui/view/projectioneffect(_:).md)
- [transformEffect(_:)](swiftui/view/transformeffect(_:).md)
- [transform3DEffect(_:)](swiftui/view/transform3deffect(_:).md)
