Remove rotate.glsl

This commit is contained in:
Grant Sanderson 2023-01-19 10:52:53 -08:00
parent c873d073e2
commit 6839de9a31
2 changed files with 1 additions and 20 deletions

View file

@ -4,4 +4,4 @@ There seems to be no analog to #include in C++ for OpenGL shaders. While there
with the code from one of the files in this folder.
The functions in this file often include reference to uniforms which are assumed to be part of the surrounding context into which they are inserted.
The functions in this file may include declarations of uniforms, so one should not re-declare those in the surrounding context.

View file

@ -1,19 +0,0 @@
mat3 rotationMatrix(vec3 axis, float angle) {
axis = normalize(axis);
float s = sin(angle);
float c = cos(angle);
float oc = 1.0 - c;
float ax = axis.x;
float ay = axis.y;
float az = axis.z;
return mat3(
oc * ax * ax + c, oc * ax * ay - az * s, oc * az * ax + ay * s,
oc * ax * ay + az * s, oc * ay * ay + c, oc * ay * az - ax * s,
oc * az * ax - ay * s, oc * ay * az + ax * s, oc * az * az + c
);
}
vec3 rotate(vec3 vect, float angle, vec3 axis){
return rotationMatrix(axis, angle) * vect;
}