---
title: "transformMat4(): IR builder function in typeshade/core/ir"
description: "transformMat4, an IR builder function in typeshade/core/ir. mat4x4<f32> × vec4<f32> → vec4<f32>: the matrix-vector product…"
url: https://typeshade.dev/api/transformmat4/
language: en
---

# `transformMat4()`

Function in Builtins

`mat4x4<f32>` × `vec4<f32>` → `vec4<f32>`: the matrix-vector product, as in a model-view-projection transform.

`import { transformMat4 } from 'typeshade/core/ir'`

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

## Syntax

```ts
const transformMat4: (
  m: ReadonlyNode<"mat4x4<f32>">,
  v: ReadonlyNode<"vec4<f32>">,
) => Node<"vec4<f32>">
```

## Parameters

**`m` `ReadonlyNode<'mat4x4<f32>'>`**

**`v` `ReadonlyNode<'vec4<f32>'>`**

## Return value

`Node<'vec4<f32>'>`

## Description

The generic `.mul` rejects a matrix operand, since a matrix is neither a scalar nor a matching vector; this is the explicit form.

## Source

[`src/core/ir/node.ts`, line 2465](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L2465), at commit af54ddad5
