Skip to content

Latest commit

 

History

History
99 lines (73 loc) · 5.15 KB

matrix_transform.md

File metadata and controls

99 lines (73 loc) · 5.15 KB

matrix_transform methods

The following methods are all part of the matrix_transform methods.
Defines functions that generate common transformation matrices.

Table of contents

identity() function

glm.identity(matrix_type: type) -> matNxM

  Builds an identity matrix.

lookAt() function

glm.lookAt(eye: vec3, center: vec3, up: vec3) -> mat4x4

  Build a look at view matrix based on the default handedness.

lookAtLH() function

glm.lookAtLH(eye: vec3, center: vec3, up: vec3) -> mat4x4

  Build a left handed look at view matrix.

lookAtRH() function

glm.lookAtRH(eye: vec3, center: vec3, up: vec3) -> mat4x4

  Build a right handed look at view matrix.

rotate() function

glm.rotate(angle: number, axis: vec3) -> mat4x4

  Builds a rotation 4 x 4 matrix created from an axis vector and an angle.

glm.rotate(angle: number) -> mat3x3

  Builds a rotation 3 x 3 matrix created from an angle.

glm.rotate(m: mat4x4, angle: number, axis: vec3) -> mat4x4

  Builds a rotation 4 x 4 matrix created from an axis vector and an angle.
  m is the input matrix multiplied by this translation matrix

glm.rotate(m: mat3x3, angle: number) -> mat3x3

  Builds a rotation 3 x 3 matrix created from an angle.
  m is the input matrix multiplied by this translation matrix

glm.rotate(v: vec2, angle: float) -> vec2

  Rotate a two dimensional vector.

glm.rotate(v: vec3, angle: float, normal: vec3) -> vec3

  Rotate a three dimensional vector around an axis.

glm.rotate(v: vec4, angle: float, normal: vec3) -> vec4

  Rotate a four dimensional vector around an axis.

glm.rotate(q: quat, angle: float, axis: vec3) -> quat

  Rotates a quaternion from a vector of 3 components axis and an angle.

rotate_slow() function

glm.rotate_slow(m: mat4x4, angle: number, axis: vec3) -> mat4x4

  Builds a rotation 4 x 4 matrix created from an axis vector and an angle.

scale() function

glm.scale(v: vec3) -> mat4x4

  Builds a scale 4 x 4 matrix created from 3 scalars.

glm.scale(v: vec2) -> mat3x3

  Builds a scale 3 x 3 matrix created from a vector of 2 components.

glm.scale(m: mat4x4, v: vec3) -> mat4x4

  Builds a scale 4 x 4 matrix created from 3 scalars.
  m is the input matrix multiplied by this translation matrix

glm.scale(m: mat3x3, v: vec2) -> mat3x3

  Builds a scale 3 x 3 matrix created from a vector of 2 components.
  m is the input matrix multiplied by this translation matrix

scale_slow() function

glm.scale_slow(m: mat4x4, v: vec3) -> mat4x4

  Builds a scale 4 x 4 matrix created from 3 scalars.

translate() function

glm.translate(v: vec3) -> mat4x4

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

glm.translate(v: vec2) -> mat3x3

  Builds a translation 3 x 3 matrix created from a vector of 2 components.

glm.translate(m: mat4x4, v: vec3) -> mat4x4

  Builds a translation 4 x 4 matrix created from a vector of 3 components.
  m is the input matrix multiplied by this translation matrix

glm.translate(m: mat3x3, v: vec2) -> mat3x3

  Builds a translation 3 x 3 matrix created from a vector of 2 components.
  m is the input matrix multiplied by this translation matrix