transform3DEffect(_:)
Applies a 3D transformation to this view’s rendered output.
Declaration
nonisolated func transform3DEffect(_ transform: AffineTransform3D) -> some View
Parameters
- transform:
The 3D transformation to apply to the view, interpreting it as a 3D plane in space.
Return Value
A view that renders transformed according to the provided transform
Apply a transform about an anchor
This does not adjust the transform relative to an anchor point. Instead, apply the scale and rotation separately using scaleEffect(_:anchor:) together with rotation3DEffect(_:anchor:).
Model3D(url: URL(string: "https://example.com/robot.usdz")!)
.scaleEffect(transform.scale)
.rotation3DEffect(transform.rotation ?? .identity)
.transform3DEffect(AffineTransform3D(
translation: transform.translation))See Also
Scaling, rotating, or transforming a view
scaledToFill()scaledToFit()scaleEffect(_:anchor:)scaleEffect(_:anchor:)scaleEffect(x:y:anchor:)scaleEffect(x:y:z:anchor:)aspectRatio(_:contentMode:)rotationEffect(_:anchor:)rotation3DEffect(_:axis:anchor:anchorZ:perspective:)perspectiveRotationEffect(_:axis:anchor:anchorZ:perspective:)rotation3DEffect(_:anchor:)rotation3DEffect(_:axis:anchor:)transformEffect(_:)projectionEffect(_:)ProjectionTransform