glm matrix initialization
This commit is contained in:
parent
e7b371eef3
commit
cd8274c294
49 changed files with 127 additions and 127 deletions
|
|
@ -617,11 +617,11 @@ public:
|
|||
void updateUniformBuffers()
|
||||
{
|
||||
// Vertex shader
|
||||
glm::mat4 viewMatrix = glm::mat4();
|
||||
glm::mat4 viewMatrix = glm::mat4(1.0f);
|
||||
uboVS.projection = glm::perspective(glm::radians(splitScreen ? 30.0f : 45.0f), (float)width / (float)(height * ((splitScreen) ? 0.5f : 1.0f)), 0.001f, 256.0f);
|
||||
viewMatrix = glm::translate(viewMatrix, glm::vec3(0.0f, 0.0f, splitScreen ? zoom : zoom - 2.0f));
|
||||
|
||||
uboVS.model = glm::mat4();
|
||||
uboVS.model = glm::mat4(1.0f);
|
||||
uboVS.model = viewMatrix * glm::translate(uboVS.model, cameraPos);
|
||||
uboVS.model = glm::rotate(uboVS.model, glm::radians(rotation.x), glm::vec3(1.0f, 0.0f, 0.0f));
|
||||
uboVS.model = glm::rotate(uboVS.model, glm::radians(rotation.y), glm::vec3(0.0f, 1.0f, 0.0f));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue