Answer the question
In order to leave comments, you need to log in
What to do with multiple transformation matrices?
Hello! Let's say that I have several objects on the stage and I need them all (or only a few) to somehow transform (someone moved, moved, etc.), therefore, each of those who move / move / scale should have a transformation matrix, but what about her?
Now the vertex shader code (there is only one object and one transformation matrix on the stage) looks like this
#version 330
layout (location = 0) in vec3 position;
// выход на вход в фрагментный шейдер
// Приписка 'pass_' для моего удобства
in vec2 uv;
out vec2 pass_uv;
//матрицы
uniform mat4 ModelMatrix;
uniform mat4 ViewMatrix;
uniform mat4 projectionMatrix;
void main() {
gl_Position = projectionMatrix * ViewMatrix * ModelMatrix * vec4(position, 1.0f);
pass_uv = uv;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question