mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-29 08:26:37 +01:00
rotating stuff renders too now
This commit is contained in:
parent
a56d08b78e
commit
379ff9302b
2 changed files with 3 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
|||
#version 330 core
|
||||
#version 420 core
|
||||
#define PI 3.1415926538
|
||||
|
||||
layout (location = 0) in vec3 aPos;
|
||||
|
|
|
@ -40,8 +40,7 @@ mat4 kineticRotation() {
|
|||
float degrees = rotationOffset + time * speed * -3./10.;
|
||||
float angle = fract(degrees / 360.) * PI * 2.;
|
||||
|
||||
vec3 axis = normalize(rotationAxis);
|
||||
return rotate(axis, angle);
|
||||
return rotate(normalize(rotationAxis), angle);
|
||||
}
|
||||
|
||||
mat4 contraptionRotation() {
|
||||
|
@ -64,7 +63,7 @@ void main() {
|
|||
vec4 worldPos = contraptionRotation * localPos + vec4(cPos + 0.5, 0);
|
||||
|
||||
BoxCoord = (worldPos.xyz - lightBoxMin) / lightBoxSize;
|
||||
Diffuse = diffuse(normalize(contraptionRotation * localRotation * vec4(aNormal, 0.)).xyz);
|
||||
Diffuse = diffuse(normalize(contraptionRotation * kineticRotation * vec4(aNormal, 0.)).xyz);
|
||||
Color = vec4(1.);
|
||||
TexCoords = aTexCoords;
|
||||
gl_Position = projection * view * worldPos;
|
||||
|
|
Loading…
Reference in a new issue