Skip to content

Commit

Permalink
[icon-layer] use sin to get 180-360 degree ranges (visgl#780)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnavvy authored and Shaojing Li committed Jul 12, 2017
1 parent a137a0e commit 1b83d02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/layers/core/icon-layer/icon-layer-vertex.glsl.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ varying vec2 vTextureCoords;
vec2 rotate_by_angle(vec2 vertex, float angle) {
float angle_radian = angle * PI / 180.0;
float cos_angle = cos(angle_radian);
float sin_angle = sqrt(1.0 - cos_angle * cos_angle);
float sin_angle = sin(angle_radian);
mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);
return rotationMatrix * vertex;
}
Expand Down

0 comments on commit 1b83d02

Please sign in to comment.