i have 2 position variables: aPos and worldPos.
aPos - local pos relative to the model
worldPos - world pos relative to the world
vertex shader code: (sth like this)
#version 330 core
layout (location=0) in vec3 aPos;
// other stuff for fragment shader
// ...
out vec3 FragPos;
uniform mat4 camMatrix;
uniform mat4 model;
uniform mat4 translation;
uniform mat4 rotation;
uniform mat4 scale;
uniform vec3 worldPos;
void main()
{
FragPos = vec3(model * translation * rotation * scale * vec4(aPos + worldPos, 1.0));
// normal, colors, UVs, etc.
// ...
gl_Position = camMatrix * vec4(FragPos, 1.0);
}
how can i move the meshes in one direction relative to the world without rotation?