mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-11-14 14:33:57 +01:00
rotating stuff renders too now
This commit is contained in:
parent
a56d08b78e
commit
379ff9302b
@ -1,4 +1,4 @@
|
|||||||
#version 330 core
|
#version 420 core
|
||||||
#define PI 3.1415926538
|
#define PI 3.1415926538
|
||||||
|
|
||||||
layout (location = 0) in vec3 aPos;
|
layout (location = 0) in vec3 aPos;
|
||||||
|
@ -40,8 +40,7 @@ mat4 kineticRotation() {
|
|||||||
float degrees = rotationOffset + time * speed * -3./10.;
|
float degrees = rotationOffset + time * speed * -3./10.;
|
||||||
float angle = fract(degrees / 360.) * PI * 2.;
|
float angle = fract(degrees / 360.) * PI * 2.;
|
||||||
|
|
||||||
vec3 axis = normalize(rotationAxis);
|
return rotate(normalize(rotationAxis), angle);
|
||||||
return rotate(axis, angle);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mat4 contraptionRotation() {
|
mat4 contraptionRotation() {
|
||||||
@ -64,7 +63,7 @@ void main() {
|
|||||||
vec4 worldPos = contraptionRotation * localPos + vec4(cPos + 0.5, 0);
|
vec4 worldPos = contraptionRotation * localPos + vec4(cPos + 0.5, 0);
|
||||||
|
|
||||||
BoxCoord = (worldPos.xyz - lightBoxMin) / lightBoxSize;
|
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.);
|
Color = vec4(1.);
|
||||||
TexCoords = aTexCoords;
|
TexCoords = aTexCoords;
|
||||||
gl_Position = projection * view * worldPos;
|
gl_Position = projection * view * worldPos;
|
||||||
|
Loading…
Reference in New Issue
Block a user