Created
July 5, 2016 15:48
-
-
Save samrat/f5f25efd0285694204ce6be5a0e5b7f0 to your computer and use it in GitHub Desktop.
arrowhead in a geometry shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Arrowhead */ | |
float ang = (PI / 6.0) - atan(vDir[0].y, vDir[0].x); | |
gl_Position = gl_in[0].gl_Position + vec4(vDir[0], 0.0, 0.0) + vec4(-cos(ang)*0.04, sin(ang)*0.04, 0.0, 0.0); | |
EmitVertex(); | |
gl_Position = gl_in[0].gl_Position + vec4(vDir[0], 0.0, 0.0); | |
EmitVertex(); | |
ang = -(PI / 6.0) - atan(vDir[0].y, vDir[0].x); | |
gl_Position = gl_in[0].gl_Position + vec4(vDir[0], 0.0, 0.0) + vec4(-cos(ang)*0.04, sin(ang)*0.04, 0.0, 0.0); | |
EmitVertex(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment