[][src]Function gramit::transform::look_at

pub fn look_at(eye: &Vec3, center: &Vec3, up: &Vec3) -> Mat4

Build a look-at view matrix.

Parameters

  • eye The position of the camera.
  • center The point towards which the camera is facing.
  • up A vector in the upwards direction, usually vec3!(0.0, 0.0, 1.0).

Usage Warnings

An up vector parallel to the camera's facing direction will result in a singular matrix that collapses all points onto the z axis. This is probably not what you want. The function does not check for this condition, so users should check their input to avoid it.