Function glm::ext::translate [] [src]

pub fn translate<T>(m: &Matrix4<T>, v: Vector3<T>) -> Matrix4<T> where
    T: BaseFloat

Builds a translation 4 * 4 matrix created from a vector of 3 components.

Uses input matrix m and translation vector coordinates v.

Example

use glm::*;
use glm::ext::*;

let matrix = translate(&num::one(), vec3(1., 2., 3.));
assert_eq!(matrix[3], vec4(1., 2., 3., 1.));