---
layout: doc
title: general / translate
---
# translate

### NAME

    translate() - apply a translation to a matrix

### SYNOPSIS

    float array translate( float array matrix, float x, float y, float z );

### DESCRIPTION

    Applies a translation of x, y, and z to matrix and returns matrix.
    The argument must be a 16 element float array in the format returned by
    id_matrix().

    This efun modifies the supplied matrix array in place.  Internally, the
    driver creates a translation matrix and multiplies the current matrix by
    that translation matrix.

### EXAMPLE

    float array m = id_matrix();

    m = translate(m, 10.0, 0.0, -3.0);

### SEE ALSO

    id_matrix(3), scale(3), rotate_x(3), rotate_y(3), rotate_z(3)
