mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-02 04:37:54 +08:00
Spheres model matrix generation fix
Fix of integer division resulting in some spheres being rendered at same position. Removed redundant float cast as all operands are being promoted to double anyways.
This commit is contained in:
@@ -143,8 +143,8 @@ int main()
|
|||||||
|
|
||||||
model = glm::mat4();
|
model = glm::mat4();
|
||||||
model = glm::translate(model, glm::vec3(
|
model = glm::translate(model, glm::vec3(
|
||||||
(float)(col - (nrColumns / 2)) * spacing,
|
(col - (nrColumns / 2.)) * spacing,
|
||||||
(float)(row - (nrRows / 2)) * spacing,
|
(row - (nrRows / 2.)) * spacing,
|
||||||
0.0f
|
0.0f
|
||||||
));
|
));
|
||||||
shader.setMat4("model", model);
|
shader.setMat4("model", model);
|
||||||
|
|||||||
Reference in New Issue
Block a user