Skip to content

Instantly share code, notes, and snippets.

@Groogy
Created July 16, 2017 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Groogy/694d849ff25eea998251dfc68ec76886 to your computer and use it in GitHub Desktop.
Save Groogy/694d849ff25eea998251dfc68ec76886 to your computer and use it in GitHub Desktop.
def self.translate(matrix : Matrix(T, 4, 16), translation : Vector(T, 3)) forall T
cpy = matrix.dup
cpy[3, 0] = translation.x
cpy[3, 1] = translation.y
cpy[3, 2] = translation.z
cpy
end
def self.translate(matrix : Matrix(T, 4, 16), translation : Vector(T, 3)) forall T
matrix[3, 0] = translation.x
matrix[3, 1] = translation.y
matrix[3, 2] = translation.z
matrix
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment