---
title: "matrix4x4h::transformDirection"
framework: Compute Graph
role: symbol
role_heading: Function
platforms: [iOS 27.0+, iPadOS 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: computegraph/matrix4x4h/transformdirection
---

# matrix4x4h::transformDirection

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

## Declaration

```swift
half3 matrix4x4h::transformDirection(half4x4 matrix, half3 vector)
```

## Parameters

- `matrix`: The 4x4 transformation matrix to apply.
- `vector`: The 3D direction vector to transform.

## Return Value

Return Value The transformed 3D direction vector.

## Discussion

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. note:
