stackgl / shader-school

:mortar_board: A workshopper for GLSL shaders and graphics programming
Other
4.3k stars 254 forks source link

Lesson 10 - Wrongly defines rotation matrix in row major form. #73

Closed esiegel closed 9 years ago

esiegel commented 10 years ago

I'm new to GLSL, but it seems that we should specify the translation matrix in column major order:

  mat2 rot = mat2(c, -s, s, c);
mikolalysenko commented 9 years ago

I'm not sure what the issue is here, but transposing a rotation matrix just changes whether it rotates forward or in reverse. In this case the behavior seems reasonable. Perhaps you could elaborate on what you find confusing?