Contents

transform3DEffect(_:)

Applies a 3D transformation to this view’s rendered output.

Declaration

func transform3DEffect(_ transform: AffineTransform3D) -> some VisualEffect

Parameters

  • transform:

    The 3D transformation to apply to the view, interpreting it as a 3D plane in space.

Return Value

An effect 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

Applying a transform