diff --git a/src/game.cpp b/src/game.cpp index c44909d..03d546b 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -71,6 +71,7 @@ void Game::Setup(int w, int h) { // Load OpenGL gladLoadGLLoader(SDL_GL_GetProcAddress); glEnable(GL_MULTISAMPLE); + glCullFace(GL_BACK); glEnable(GL_DEPTH_TEST); // glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); diff --git a/src/renderer/voxel.cpp b/src/renderer/voxel.cpp index 93e6ea0..0f74183 100644 --- a/src/renderer/voxel.cpp +++ b/src/renderer/voxel.cpp @@ -7,17 +7,6 @@ Voxel::Voxel(int x, int y, int z) { - - m_model = glm::translate(glm::mat4(1.0f), { (float)x, (float)y, (float)z }); - - // glm::mat4 Matrix = { - // {1, 3, 0, 0}, - // {0, 1, 0, 0}, - // {0, 0, 1, 0}, - // {0, 0, 0, 1}, - // }; - - // m_model = Matrix * m_model; // Texture winding order - top, bottom, left, right, front, back @@ -42,11 +31,9 @@ Voxel::Voxel(int x, int y, int z) { for (int i = 0; i < m_vertices.size(); i++) { - glm::vec4 tmp = { m_vertices[i], 1 }; - - glm::vec4 res = tmp * m_model; - - m_vertices[i] = { res.x, res.y, res.z }; + m_vertices[i].x += x; + m_vertices[i].y += y; + m_vertices[i].z += z; } diff --git a/src/renderer/voxel.hpp b/src/renderer/voxel.hpp index 3aa04e4..e64dac0 100644 --- a/src/renderer/voxel.hpp +++ b/src/renderer/voxel.hpp @@ -18,8 +18,6 @@ public: private: - glm::mat4 m_model; - std::vector m_vertices; std::vector m_uvs;