<!--
{
  "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/rotationMatrix(atTime:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLTransform(im)rotationMatrixAtTime:"
  },
  "title" : "rotationMatrix(atTime:)"
}
-->

# rotationMatrix(atTime:)

Returns the orientation of the transform as a rotation matrix, as of the specified time sample.

```
func rotationMatrix(atTime time: TimeInterval) -> matrix_float4x4
```

## Parameters

`time`

The time sample for which to request information.

## Return Value

The orientation, as a rotation matrix, of the transform.

## Discussion

A rotation matrix provides the same information as the vector returned by the [`rotation(atTime:)`](/documentation/ModelIO/MDLTransform/rotation(atTime:)) method, but in a form more convenient for multiplying with position vectors.

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.

Requesting a sample outside the time range clamps results to the [`minimumTime`](/documentation/ModelIO/MDLTransformComponent/minimumTime) or [`maximumTime`](/documentation/ModelIO/MDLTransformComponent/maximumTime) sample. Some asset formats support continuous sampling with interpolation for times between the samples stored in the asset; others are discrete. For an asset with discrete time information, requesting a sample time in between the samples stored in the asset returns data for the immediately preceding time.

---

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)