Skip to content

Instantly share code, notes, and snippets.

@alesegdia
Last active November 6, 2015 19:03
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 alesegdia/608c081a65794260dc0c to your computer and use it in GitHub Desktop.
Save alesegdia/608c081a65794260dc0c to your computer and use it in GitHub Desktop.
Get Backward/Up/Right vectors from mat4
// http://roy-t.nl/index.php/2010/03/04/getting-the-left-forward-and-back-vectors-from-a-view-matrix-directly/
mat4 matrix;
vec3 right ( matrix(0,0), matrix(1,0), matrix(2,1) );
vec3 up ( matrix(0,1), matrix(1,1), matrix(2,2) );
vec3 back ( matrix(0,2), matrix(1,2), matrix(2,2) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment