Fix arc rendering, allowing them to rotate
This commit is contained in:
+4
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user