Skip to content

Commit

Permalink
Fix rotation angle sign convention. Thanks @kongotech
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamrow committed Jun 26, 2019
1 parent d8efcfb commit f4a86ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/shaders/standard.vert
Expand Up @@ -104,12 +104,12 @@ void main( void )
mat4 rot_theta = mat4(1.0);
rot_theta[1][1] = rot_theta[2][2] = cos(theta);
rot_theta[1][2] = rot_theta[2][1] = sin(theta);
rot_theta[1][2] *= -1;
rot_theta[2][1] *= -1;

mat4 rot_phi = mat4(1.0);
rot_phi[0][0] = rot_phi[1][1] = cos(phi+0.5*PI);
rot_phi[0][1] = rot_phi[1][0] = sin(phi+0.5*PI);
rot_phi[0][1] *= -1;
rot_phi[1][0] *= -1;

model = model * rot_phi * rot_theta * sc;
mv = view * model;
Expand Down

0 comments on commit f4a86ea

Please sign in to comment.