This commit is contained in:
Ben
2019-10-16 00:24:44 +01:00
parent d6618506d3
commit 5a1a226ef2
3 changed files with 4 additions and 18 deletions

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -18,8 +18,6 @@ public:
private:
glm::mat4 m_model;
std::vector<glm::vec3> m_vertices;
std::vector<glm::vec3> m_uvs;