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

# Translate(3)

multiply the current transformation matrix by a translation matrix

## NAME

vpTranslate - multiply the current transformation matrix by a translation matrix

## SYNOPSIS

\#include \<volpack.h\>

vpResult

**vpTranslate(***vpc, tx, ty, tz***)**

-

  vpContext *\*vpc;*

-

  double \**tx,* \**ty,* \**tz;*

## ARGUMENTS

- *vpc*

  VolPack context from **vpCreateContext.**

- *tx*

  X component of translation vector.

- *ty*

  Y component of translation vector.

- *tz*

  Z component of translation vector.

## DESCRIPTION

**vpTranslate** is used to multiply the current transformation matrix by a 4-by-4 translation matrix.  The translation matrix is:

-

  	1	0	0	tx\
  \
   	0	1	0	ty\
  \
   	0	0	1	tz\
  \
   	0	0	0	1

Use **vpCurrentMatrix** to set the current transformation matrix.  By default, the transformation matrix is post-multiplied (M = M\*T where M is the current matrix and T is the translation matrix).  The VP\_CONCAT\_MODE option to **vpSeti** can be used to select pre-multiplication.

## STATE VARIABLES

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

## ERRORS

The return value is always VP\_OK.

## SEE ALSO

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