<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/rotation3DLayout(_:axis:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE16rotation3DLayout_4axisQrAA5AngleV_14CoreFoundation7CGFloatV1x_AJ1yAJ1zttF::OverloadGroup"
  },
  "title" : "rotation3DLayout(_:axis:)"
}
-->

# rotation3DLayout(_:axis:)

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

```
@export(implementation) 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

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.

---

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)