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

# rotation3DEffect(_:axis:anchor:)

Rotates content by an angle about an axis that you specify
as a rotation axis value.

```
@export(implementation) func rotation3DEffect(_ angle: Angle, axis: RotationAxis3D, anchor: UnitPoint3D = .center) -> some VisualEffect
```

## Parameters

`angle`

The angle by which to rotate the view’s content.

`axis`

The axis of rotation.

`anchor`

The unit point within the content about which to perform
the rotation. The default value is [`center`](/documentation/SwiftUI/UnitPoint3D/center).

## Return Value

A rotation effect.

## Discussion

This effect causes the content to appear rotated, but
doesn’t change the content’s frame. The following code
applies a rotation of 45° about the y-axis, using
the default anchor point at the center of the content:

```
Model3D(named: "robot")
    .visualEffect { content, geometryProxy in
        content
            .rotation3DEffect(.degrees(45), axis: .y)
    }
```

---

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)