summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2012-10-12 15:12:07 -0700
committerMatt Turner <mattst88@gmail.com>2012-10-12 15:12:07 -0700
commit089a29ca47ddcca7aa15f7e224aceb6fa286d970 (patch)
tree2ae8e820aed0c218003f7ad54926868c0586f994
parent9d85eb0769ade49a65d8c2d9643d3d67e5c31dcc (diff)
Draw ellipses and make them rotateHEADmaster
-rw-r--r--data/ellipse.frag9
1 files changed, 8 insertions, 1 deletions
diff --git a/data/ellipse.frag b/data/ellipse.frag
index bf35027..2436f28 100644
--- a/data/ellipse.frag
+++ b/data/ellipse.frag
@@ -4,5 +4,12 @@ uniform mat2 m = mat2(1.);
void main()
{
- gl_FragColor = vec4(1.0);
+ vec2 cartesian_PointCoord = m * ((gl_PointCoord * -2.0) + vec2(1.0));
+ vec2 len_sq = cartesian_PointCoord * cartesian_PointCoord;
+ len_sq.y /= 2.0;
+ if (len_sq.x + len_sq.y < 0.5) {
+ gl_FragColor = vec4(1.0);
+ } else {
+ discard;
+ }
}