---
name: "SetMatrix"
section: "3"
platform: "linux"
package: "libvolpack1-dev"
version: "1.0b3-10"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SetMatrix"
---

# SetMatrix(3)

load a matrix into the current transformation matrix

## NAME

vpSetMatrix - load a matrix into the current transformation matrix

## SYNOPSIS

\#include \<volpack.h\>

vpResult

**vpSetMatrix(***vpc, m***)**

-

  vpContext \**vpc;*

-

  vpMatrix4 *m;*

## ARGUMENTS

- *vpc*

  VolPack context from **vpCreateContext.**

- *m*

  Input matrix.

## DESCRIPTION

**vpSetMatrix** is used to load a 4-by-4 transformation matrix into the current transformation matrix.  Use **vpCurrentMatrix** to set the current transformation matrix.

## STATE VARIABLES

The current transformation matrix parameters can be retrieved with the following state variable codes (see vpGeti(3)): VP\_CURRENT\_MATRIX.

## ERRORS

The return value is always VP\_OK.

## SEE ALSO

[VolPack(3)](/VolPack/3.md), vpCreateContext(3), vpCurrentMatrix(3), vpGetMatrix(3)
