<!--
{
  "availability" : [
    "Reality Composer Pro: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "ComputeGraph",
  "identifier" : "/documentation/ComputeGraph/matrix4x4f/transformDirection",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Compute Graph"
    ],
    "preciseIdentifier" : "matrix4x4f::transformDirection"
  },
  "title" : "matrix4x4f::transformDirection"
}
-->

# matrix4x4f::transformDirection

Transforms a direction vector by a 4x4 matrix, ignoring translation.

```
float3 matrix4x4f::transformDirection(float4x4 matrix, float3 vector)
```

## Parameters

`matrix`

The 4x4 transformation matrix to apply.

`vector`

The 3D direction vector to transform.

## Return Value

The transformed 3D direction vector.

## Discussion

Multiplies the vector by the matrix with a `w` component of `0.0`,
so only rotation and scale are applied. This is appropriate for
normals, tangents, and other direction vectors that should not be
affected by the matrix’s translational component.

> Visual: ![Graph](matrix4x4f__transformDirection)

---

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)