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

# GetMatrix(3)

retrieve the contents of a transformation matrix

## NAME

vpGetMatrix - retrieve the contents of a transformation matrix

## SYNOPSIS

\#include \<volpack.h\>

vpResult

**vpGetMatrix(***vpc, matrix\_code, matrix***)**

-

  vpContext \**vpc;*

-

  int *matrix\_code;*

-

  vpMatrix4 *matrix;*

## ARGUMENTS

- *vpc*

  VolPack context from **vpCreateContext.**

- *matrix\_code*

  A code specifying one of the VolPack transformation matrices (VP\_MODEL, VP\_VIEW, VP\_PROJECT or VP\_SCREEN).

- *matrix*

  Matrix for storing the result.

## DESCRIPTION

**vpGetMatrix** retrieves the contents of one of the transformation matrices (see vpCurrentMatrix(3)).  The special code VP\_SCREEN causes the function to compute the transformation from object coordinates to image coordinates and return a matrix describing this transformation.

## ERRORS

The normal return value is VP\_OK.  The following error return value is possible:

- VPERROR\_BAD\_OPTION

  The *matrix\_code* argument is invalid.

## SEE ALSO

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