[client] app: rename up,right,down,left rotation to 0,90,180,270

This commit is contained in:
Geoffrey McRae
2021-01-18 14:42:57 +11:00
parent ff1dc32efe
commit 733bbf5153
4 changed files with 41 additions and 64 deletions

View File

@@ -18,25 +18,25 @@ void main()
muv.x += mouse.x;
muv.y -= mouse.y;
if (rotate == 0) // up
if (rotate == 0) // 0
{
gl_Position.xy = muv;
}
else if (rotate == 1) // down
else if (rotate == 1) // 90
{
gl_Position.x = muv.y;
gl_Position.y = -muv.x;
}
else if (rotate == 2) // 180
{
gl_Position.x = -muv.x;
gl_Position.y = -muv.y;
}
else if (rotate == 2) // left
else if (rotate == 3) // 270
{
gl_Position.x = -muv.y;
gl_Position.y = muv.x;
}
else if (rotate == 3) // right
{
gl_Position.x = muv.y;
gl_Position.y = -muv.x;
}
gl_Position.w = 1.0;
uv = vertexUV;

View File

@@ -16,25 +16,25 @@ uniform int cbMode;
void main()
{
highp vec2 ruv;
if (rotate == 0) // up
if (rotate == 0) // 0
{
ruv = uv;
}
else if (rotate == 1) // down
else if (rotate == 1) // 90
{
ruv.x = uv.y;
ruv.y = -uv.x + 1.0f;
}
else if (rotate == 2) // 180
{
ruv.x = -uv.x + 1.0f;
ruv.y = -uv.y + 1.0f;
}
else if (rotate == 2) // left
else if (rotate == 3) // 270
{
ruv.x = -uv.y + 1.0f;
ruv.y = uv.x;
}
else if (rotate == 3) // right
{
ruv.x = uv.y;
ruv.y = -uv.x + 1.0f;
}
if(nearest == 1)
color = texture(sampler1, ruv);