Fix arc rendering, allowing them to rotate

This commit is contained in:
2021-03-02 20:15:32 +01:00
parent 81f5385710
commit 8ed8c48ffe
5 changed files with 22 additions and 13 deletions
+4 -2
View File
@@ -7,6 +7,8 @@ in vec2 angles;
out vec4 fColor;
out float gl_FragDepth;
uniform float rotation;
void main()
{
vec2 pos = gl_FragCoord.xy;
@@ -16,10 +18,10 @@ void main()
);
vec2 posDiff = pos - cenPosT;
float sa = angles.x;
float sa = angles.x - rotation;
vec2 sv = vec2 (-sin(sa), cos(sa));
float saTest = dot(sv,posDiff) >= 0 ? 0 : 1;
float ea = angles.y;
float ea = angles.y - rotation;
vec2 ev = vec2 (-sin(ea), cos(ea));
float eaTest = dot(ev,posDiff) <= 0 ? 0 : 1;
float aTest = ea - sa < radians(180) ? max (saTest,eaTest)