<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLTransform/setRotation(_:forTime:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLTransform(im)setRotation:forTime:"
  },
  "title" : "setRotation(_:forTime:)"
}
-->

# setRotation(_:forTime:)

Sets the orientation of the transform for the specified time sample.

```
func setRotation(_ rotation: vector_float3, forTime time: TimeInterval)
```

## Parameters

`rotation`

The orientation, as Euler angles in radians, to set for the transform relative to its parent coordinate space.

`time`

The time sample with which to associate transform information.

## Discussion

The three components of the `rotation` vector describe counterclockwise rotation around the corresponding axes. In a coordinate system where the negative z-axis direction is considered “forward”, these components are pitch (rotation about the x-axis), yaw (rotation about the y-axis), and roll (rotation about the z-axis).

Together with the translation, scale, and shear factors, rotation information defines the local coordinate space for any object affected by the transform, relative to a parent coordinate space. To work with the complete transform, use the [`localTransform(atTime:)`](/documentation/ModelIO/MDLTransformComponent/localTransform(atTime:)) and [`setLocalTransform(_:forTime:)`](/documentation/ModelIO/MDLTransformComponent/setLocalTransform(_:forTime:)) methods.

Setting a new rotation synthesizes a complete transform matrix by combining the new translation with the [`translation(atTime:)`](/documentation/ModelIO/MDLTransform/translation(atTime:)), [`scale(atTime:)`](/documentation/ModelIO/MDLTransform/scale(atTime:)), and [`shear(atTime:)`](/documentation/ModelIO/MDLTransform/shear(atTime:)) factors for the specified time. If the new time is outside the range of the [`minimumTime`](/documentation/ModelIO/MDLTransformComponent/minimumTime) and [`maximumTime`](/documentation/ModelIO/MDLTransformComponent/maximumTime) properties, this method updates those values to reflect the range of time samples stored in the transform object.

---

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)