Core Math functions

Table of Contents

  1. Creating Vectors and Matrices

  2. Accessing Vector Components

  3. Vector and Matrix Operations

  4. Binding Core Math Functions

Creating Vectors and Matrices

Creating vec2 objects

local v1 = vec2()
local v2 = vec2(1.0)
local v3 = vec2(1.0, 2.0)

Creating vec3 objects

local v1 = glm.vec3()
local v2 = glm.vec3(1.0)
local v3 = glm.vec3(1.0, 2.0, 3.0)

Creating vec4 objects

local v1 = glm.vec4()
local v2 = glm.vec4(1.0)
local v3 = glm.vec4(1.0, 2.0, 3.0, 4.0)

Creating mat3 objects

Accessing Vector Components

Accessing vec2 components

Accessing vec3 components

Accessing vec4 components

Vector and Matrix Operations

Addition

Subtraction

Multiplication

Division

Constants

Functions

Last updated

Was this helpful?