global functions

- glm::frustum()
- glm::frustumLH()
- glm::frustumRH()
- glm::infinitePerspective()
- glm::infinitePerspectiveLH()
- glm::infinitePerspectiveRH()
- glm::lookAt()
- glm::lookAtLH()
- glm::lookAtRH()
- glm::ortho()
- glm::orthoLH()
- glm::orthoRH()
- glm::perspective()
- glm::perspectiveFov()
- glm::perspectiveFovLH()
- glm::perspectiveFovRH()
- glm::perspectiveLH()
- glm::perspectiveRH()
- glm::pickMatrix()
- glm::project()
- glm::rotate()
- glm::scale()
- glm::translate()
- glm::tweakedInfinitePerspective()
- glm::unProject()

# glm::frustum(...)

## tmat4x4 glm::frustum(T left, T right, T bottom, T top, T near, T far)

*Documentation from code comments*

*Documentation from code comments*

Creates a frustum matrix with default handedness.

**Parameters:**

left

right

bottom

top

near

far

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

# glm::frustumLH(...)

## tmat4x4 glm::frustumLH(T left, T right, T bottom, T top, T near, T far)

*Documentation from code comments*

*Documentation from code comments*

Creates a left handed frustum matrix.

**Parameters:**

left

right

bottom

top

near

far

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

# glm::frustumRH(...)

## tmat4x4 glm::frustumRH(T left, T right, T bottom, T top, T near, T far)

*Documentation from code comments*

*Documentation from code comments*

Creates a right handed frustum matrix.

**Parameters:**

left

right

bottom

top

near

far

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

# glm::infinitePerspective(...)

## tmat4x4 glm::infinitePerspective(T fovy, T aspect, T near)

*Documentation from code comments*

*Documentation from code comments*

Creates a matrix for a symmetric perspective-view frustum with far plane at infinite with default handedness.

**Parameters:**

fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.

aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).

near Specifies the distance from the viewer to the near clipping plane (always positive).

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

# glm::infinitePerspectiveLH(...)

## tmat4x4 glm::infinitePerspectiveLH(T fovy, T aspect, T near)

*Documentation from code comments*

*Documentation from code comments*

Creates a matrix for a left handed, symmetric perspective-view frustum with far plane at infinite.

**Parameters:**

fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.

aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).

near Specifies the distance from the viewer to the near clipping plane (always positive).

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

# glm::infinitePerspectiveRH(...)

## tmat4x4 glm::infinitePerspectiveRH(T fovy, T aspect, T near)

*Documentation from code comments*

*Documentation from code comments*

Creates a matrix for a right handed, symmetric perspective-view frustum with far plane at infinite.

**Parameters:**

fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.

aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).

near Specifies the distance from the viewer to the near clipping plane (always positive).

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

# glm::lookAt(...)

## glm::mat4 glm::lookAt(const glm::vec3 &eye=P, const glm::vec3 ¢er=P, const glm::vec3 &up=P)

*Documentation from code comments*

*Documentation from code comments*

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

**Parameters:**

eye Position of the camera

center Position where the camera is looking at

up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)

**See also**: gtc_matrix_transform

**See also**: - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)

# glm::lookAtLH(...)

## glm::mat4 glm::lookAtLH(const glm::vec3 &eye=P, const glm::vec3 ¢er=P, const glm::vec3 &up=P)

*Documentation from code comments*

*Documentation from code comments*

Build a left handed look at view matrix.

**Parameters:**

eye Position of the camera

center Position where the camera is looking at

up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)

**See also**: gtc_matrix_transform

**See also**: - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)

# glm::lookAtRH(...)

## glm::mat4 glm::lookAtRH(const glm::vec3 &eye=P, const glm::vec3 ¢er=P, const glm::vec3 &up=P)

*Documentation from code comments*

*Documentation from code comments*

Build a right handed look at view matrix.

**Parameters:**

eye Position of the camera

center Position where the camera is looking at

up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)

**See also**: gtc_matrix_transform

**See also**: - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)

# glm::ortho(...)

## tmat4x4 glm::ortho(T left, T right, T bottom, T top)

*Documentation from code comments*

*Documentation from code comments*

Creates a matrix for projecting two-dimensional coordinates onto the screen.

**Parameters:**

left

right

bottom

top

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

**See also**: - glm::ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar)

# glm::ortho(...)

## tmat4x4 glm::ortho(T left, T right, T bottom, T top, T zNear, T zFar)

*Documentation from code comments*

*Documentation from code comments*

Creates a matrix for an orthographic parallel viewing volume, using the default handedness.

**Parameters:**

left

right

bottom

top

zNear

zFar

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

**See also**: - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)

# glm::orthoLH(...)

## tmat4x4 glm::orthoLH(T left, T right, T bottom, T top, T zNear, T zFar)

*Documentation from code comments*

*Documentation from code comments*

Creates a matrix for an orthographic parallel viewing volume, using left-handedness.

**Parameters:**

left

right

bottom

top

zNear

zFar

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

**See also**: - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)

# glm::orthoRH(...)

## tmat4x4 glm::orthoRH(T left, T right, T bottom, T top, T zNear, T zFar)

*Documentation from code comments*

*Documentation from code comments*

Creates a matrix for an orthographic parallel viewing volume, using right-handedness.

**Parameters:**

left

right

bottom

top

zNear

zFar

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

**See also**: - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)

# glm::perspective(...)

## tmat4x4 glm::perspective(T fovy, T aspect, T near, T far)

*Documentation from code comments*

*Documentation from code comments*

Creates a matrix for a symetric perspective-view frustum based on the default handedness.

**Parameters:**

fovy Specifies the field of view angle in the y direction. Expressed in radians.

near Specifies the distance from the viewer to the near clipping plane (always positive).

far Specifies the distance from the viewer to the far clipping plane (always positive).

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

# glm::perspectiveFov(...)

## tmat4x4 glm::perspectiveFov(T fov, T width, T height, T near, T far)

*Documentation from code comments*

*Documentation from code comments*

Builds a perspective projection matrix based on a field of view and the default handedness.

**Parameters:**

fov Expressed in radians.

width

height

near Specifies the distance from the viewer to the near clipping plane (always positive).

far Specifies the distance from the viewer to the far clipping plane (always positive).

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

# glm::perspectiveFovLH(...)

## tmat4x4 glm::perspectiveFovLH(T fov, T width, T height, T near, T far)

*Documentation from code comments*

*Documentation from code comments*

Builds a left handed perspective projection matrix based on a field of view.

**Parameters:**

fov Expressed in radians.

width

height

near Specifies the distance from the viewer to the near clipping plane (always positive).

far Specifies the distance from the viewer to the far clipping plane (always positive).

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

# glm::perspectiveFovRH(...)

## tmat4x4 glm::perspectiveFovRH(T fov, T width, T height, T near, T far)

*Documentation from code comments*

*Documentation from code comments*

Builds a right handed perspective projection matrix based on a field of view.

**Parameters:**

fov Expressed in radians.

width

height

near Specifies the distance from the viewer to the near clipping plane (always positive).

far Specifies the distance from the viewer to the far clipping plane (always positive).

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

# glm::perspectiveLH(...)

## tmat4x4 glm::perspectiveLH(T fovy, T aspect, T near, T far)

*Documentation from code comments*

*Documentation from code comments*

Creates a matrix for a left handed, symetric perspective-view frustum.

**Parameters:**

fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.

near Specifies the distance from the viewer to the near clipping plane (always positive).

far Specifies the distance from the viewer to the far clipping plane (always positive).

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

# glm::perspectiveRH(...)

## tmat4x4 glm::perspectiveRH(T fovy, T aspect, T near, T far)

*Documentation from code comments*

*Documentation from code comments*

Creates a matrix for a right handed, symetric perspective-view frustum.

**Parameters:**

fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.

near Specifies the distance from the viewer to the near clipping plane (always positive).

far Specifies the distance from the viewer to the far clipping plane (always positive).

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

# glm::pickMatrix(...)

## glm::mat4 glm::pickMatrix(const glm::vec2 ¢er=P, const glm::vec2 &delta=P, const tvec4 &viewport=P)

*Documentation from code comments*

*Documentation from code comments*

Define a picking region

**Parameters:**

center

delta

viewport

**Type parameters:**

T Native type used for the computation. Currently supported: half (not recommanded), float or double.

U Currently supported: Floating-point types and integer types.

**See also**: gtc_matrix_transform

# glm::project(...)

## glm::vec3 glm::project(const glm::vec3 &obj=P, const glm::mat4 &model=P, const glm::mat4 &proj=P, const tvec4 &viewport=P)

*Documentation from code comments*

*Documentation from code comments*

Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates.

**Parameters:**

obj Specify the object coordinates.

model Specifies the current modelview matrix

proj Specifies the current projection matrix

viewport Specifies the current viewport @return Return the computed window coordinates.

**Type parameters:**

T Native type used for the computation. Currently supported: half (not recommanded), float or double.

U Currently supported: Floating-point types and integer types.

**See also**: gtc_matrix_transform

# glm::rotate(...)

## glm::mat4 glm::rotate(const glm::mat4 &m=P, T angle, const glm::vec3 &axis=P)

*Documentation from code comments*

*Documentation from code comments*

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

**Parameters:**

m Input matrix multiplied by this rotation matrix.

angle Rotation angle expressed in radians.

axis Rotation axis, recommended to be normalized.

**Type parameters:**

T Value type used to build the matrix. Supported: half, float or double.

**See also**: gtc_matrix_transform

**See also**: - rotate(tmat4x4

**See also**: - rotate(T angle, tvec3

# glm::scale(...)

## glm::mat4 glm::scale(const glm::mat4 &m=P, const glm::vec3 &v=P)

*Documentation from code comments*

*Documentation from code comments*

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

**Parameters:**

m Input matrix multiplied by this scale matrix.

v Ratio of scaling for each axis.

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

**See also**: - scale(tmat4x4

**See also**: - scale(tvec3

# glm::translate(...)

## glm::mat4 glm::translate(const glm::mat4 &m=P, const glm::vec3 &v=P)

*Documentation from code comments*

*Documentation from code comments*

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

**Parameters:**

m Input matrix multiplied by this translation matrix.

v Coordinates of a translation vector.

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

```
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
...
glm::mat4 m = glm::translate(glm::mat4(1.0f), glm::vec3(1.0f));
// m[0][0] == 1.0f, m[0][1] == 0.0f, m[0][2] == 0.0f, m[0][3] == 0.0f
// m[1][0] == 0.0f, m[1][1] == 1.0f, m[1][2] == 0.0f, m[1][3] == 0.0f
// m[2][0] == 0.0f, m[2][1] == 0.0f, m[2][2] == 1.0f, m[2][3] == 0.0f
// m[3][0] == 1.0f, m[3][1] == 1.0f, m[3][2] == 1.0f, m[3][3] == 1.0f
```

**See also**: gtc_matrix_transform

**See also**: - translate(tmat4x4

**See also**: - translate(tvec3

# glm::tweakedInfinitePerspective(...)

## tmat4x4 glm::tweakedInfinitePerspective(T fovy, T aspect, T near)

*Documentation from code comments*

*Documentation from code comments*

Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.

**Parameters:**

fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.

near Specifies the distance from the viewer to the near clipping plane (always positive).

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

# glm::tweakedInfinitePerspective(...)

## tmat4x4 glm::tweakedInfinitePerspective(T fovy, T aspect, T near, T ep)

*Documentation from code comments*

*Documentation from code comments*

Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.

**Parameters:**

fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.

near Specifies the distance from the viewer to the near clipping plane (always positive).

ep

**Type parameters:**

T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.

**See also**: gtc_matrix_transform

# glm::unProject(...)

## glm::vec3 glm::unProject(const glm::vec3 &win=P, const glm::mat4 &model=P, const glm::mat4 &proj=P, const tvec4 &viewport=P)

*Documentation from code comments*

*Documentation from code comments*

Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.

**Parameters:**

win Specify the window coordinates to be mapped.

model Specifies the modelview matrix

proj Specifies the projection matrix

viewport Specifies the viewport @return Returns the computed object coordinates.

**Type parameters:**

T Native type used for the computation. Currently supported: half (not recommanded), float or double.

U Currently supported: Floating-point types and integer types.

**See also**: gtc_matrix_transform

Last updated Wednesday, 24 March 2021 22:24:11 UTC - 3584230cdd16cdb7de5ec8a7f713af37f38ca6dd

Hosting for openFrameworks is generously provided by Rackspace

If you have any doubt about the usage of this module you can ask in the forum.

If you want to contribute better documentation or start documenting this section you can do so here

If you find anything wrong with this docs you can report any error by opening an issue