summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2012-10-10 18:16:20 -0700
committerMatt Turner <mattst88@gmail.com>2012-10-10 18:16:20 -0700
commit8832441dd75848cac5c105097396ffb34343c5cb (patch)
tree28046943cd95f5820ea472f7a8d6ceaf98125347 /data
parentd3f459377144069bb7550922e1d9470db1325740 (diff)
Do angle addition
Diffstat (limited to 'data')
-rw-r--r--data/angle_addition.vert6
1 files changed, 4 insertions, 2 deletions
diff --git a/data/angle_addition.vert b/data/angle_addition.vert
index f410305..72d745e 100644
--- a/data/angle_addition.vert
+++ b/data/angle_addition.vert
@@ -5,8 +5,10 @@ uniform float rotation_angle;
void main()
{
- gl_Position.x = z.x;
- gl_Position.y = z.y;
+ float x = z.x * cos(z.y);
+ float y = z.x * sin(z.y);
+ gl_Position.x = x * cos(rotation_angle) - y * sin(rotation_angle);
+ gl_Position.y = x * sin(rotation_angle) + y * cos(rotation_angle);
gl_Position.z = 0.;
gl_Position.w = 1.;
gl_PointSize = 32.;