Corrections.
This commit is contained in:
parent
7b81f6be61
commit
f3a3e0c27f
@ -68,6 +68,7 @@ void Engine::Render(float elapsedTime)
|
|||||||
|
|
||||||
m_player.Move(m_keyW, m_keyS, m_keyA, m_keyD, elapsedTime);
|
m_player.Move(m_keyW, m_keyS, m_keyA, m_keyD, elapsedTime);
|
||||||
m_player.ApplyTransformation(all);
|
m_player.ApplyTransformation(all);
|
||||||
|
all.Use();
|
||||||
|
|
||||||
// Skybox
|
// Skybox
|
||||||
m_textureSkybox.Bind();
|
m_textureSkybox.Bind();
|
||||||
@ -112,7 +113,7 @@ void Engine::Render(float elapsedTime)
|
|||||||
glEnd();
|
glEnd();
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
all.Use();
|
|
||||||
// Plancher
|
// Plancher
|
||||||
// Les vertex doivent etre affiches dans le sens anti-horaire (CCW)
|
// Les vertex doivent etre affiches dans le sens anti-horaire (CCW)
|
||||||
m_textureFloor.Bind();
|
m_textureFloor.Bind();
|
||||||
@ -134,19 +135,19 @@ void Engine::Render(float elapsedTime)
|
|||||||
all.ApplyTranslation(0.f, 0.f, -10.f);
|
all.ApplyTranslation(0.f, 0.f, -10.f);
|
||||||
all.ApplyRotation(gameTime * 100.f, 0.f, 1.f, 0.f);
|
all.ApplyRotation(gameTime * 100.f, 0.f, 1.f, 0.f);
|
||||||
all.ApplyRotation(gameTime * 100.f, 0.f, 0.f, 1.f);
|
all.ApplyRotation(gameTime * 100.f, 0.f, 0.f, 1.f);
|
||||||
all.ApplyRotation(gameTime * 100.f, 1.f, 0.f, 0.f);
|
//all.ApplyRotation(gameTime * 100.f, 1.f, 0.f, 0.f);
|
||||||
all.Use();
|
all.Use();
|
||||||
m_textureCube.Bind();
|
m_textureCube.Bind();
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
|
|
||||||
glNormal3f(0, 0, 1);
|
glNormal3f(0, 0, 1);
|
||||||
glTexCoord2f(0, 0);
|
|
||||||
glVertex3f(-0.5f, -0.5f, -0.5f);
|
|
||||||
glTexCoord2f(1, 0);
|
glTexCoord2f(1, 0);
|
||||||
|
glVertex3f(-0.5f, -0.5f, -0.5f);
|
||||||
|
glTexCoord2f(0, 0);
|
||||||
glVertex3f(0.5f, -0.5f, -0.5f);
|
glVertex3f(0.5f, -0.5f, -0.5f);
|
||||||
glTexCoord2f(1, 1);
|
|
||||||
glVertex3f(0.5f, 0.5f, -0.5f);
|
|
||||||
glTexCoord2f(0, 1);
|
glTexCoord2f(0, 1);
|
||||||
|
glVertex3f(0.5f, 0.5f, -0.5f);
|
||||||
|
glTexCoord2f(1, 1);
|
||||||
glVertex3f(-0.5f, 0.5f, -0.5f);
|
glVertex3f(-0.5f, 0.5f, -0.5f);
|
||||||
|
|
||||||
glNormal3f(0, 0, -1);
|
glNormal3f(0, 0, -1);
|
||||||
@ -159,27 +160,27 @@ void Engine::Render(float elapsedTime)
|
|||||||
glTexCoord2f(0, 1);
|
glTexCoord2f(0, 1);
|
||||||
glVertex3f(-0.5f, 0.5f, 0.5f);
|
glVertex3f(-0.5f, 0.5f, 0.5f);
|
||||||
|
|
||||||
glNormal3f(0, 1, 0);
|
glNormal3f(-1, 0, 0);
|
||||||
glTexCoord2f(0, 0);
|
glTexCoord2f(0, 0);
|
||||||
glVertex3f(-0.5f, -0.5f, -0.5f);
|
glVertex3f(-0.5f, -0.5f, -0.5f);
|
||||||
glTexCoord2f(1, 0);
|
glTexCoord2f(0, 1);
|
||||||
glVertex3f(-0.5f, 0.5f, -0.5f);
|
glVertex3f(-0.5f, 0.5f, -0.5f);
|
||||||
glTexCoord2f(1, 1);
|
glTexCoord2f(1, 1);
|
||||||
glVertex3f(-0.5f, 0.5f, 0.5f);
|
glVertex3f(-0.5f, 0.5f, 0.5f);
|
||||||
glTexCoord2f(0, 1);
|
glTexCoord2f(1, 0);
|
||||||
glVertex3f(-0.5f, -0.5f, 0.5f);
|
glVertex3f(-0.5f, -0.5f, 0.5f);
|
||||||
|
|
||||||
glNormal3f(0, -1, 0);
|
glNormal3f(1, 0, 0);
|
||||||
glTexCoord2f(0, 0);
|
|
||||||
glVertex3f(0.5f, -0.5f, -0.5f);
|
|
||||||
glTexCoord2f(1, 0);
|
glTexCoord2f(1, 0);
|
||||||
glVertex3f(0.5f, 0.5f, -0.5f);
|
glVertex3f(0.5f, -0.5f, -0.5f);
|
||||||
glTexCoord2f(1, 1);
|
glTexCoord2f(1, 1);
|
||||||
glVertex3f(0.5f, 0.5f, 0.5f);
|
glVertex3f(0.5f, 0.5f, -0.5f);
|
||||||
glTexCoord2f(0, 1);
|
glTexCoord2f(0, 1);
|
||||||
|
glVertex3f(0.5f, 0.5f, 0.5f);
|
||||||
|
glTexCoord2f(0, 0);
|
||||||
glVertex3f(0.5f, -0.5f, 0.5f);
|
glVertex3f(0.5f, -0.5f, 0.5f);
|
||||||
|
|
||||||
glNormal3f(1, 0, 0);
|
glNormal3f(0, 1, 0);
|
||||||
glTexCoord2f(0, 0);
|
glTexCoord2f(0, 0);
|
||||||
glVertex3f(-0.5f, 0.5f, -0.5f);
|
glVertex3f(-0.5f, 0.5f, -0.5f);
|
||||||
glTexCoord2f(1, 0);
|
glTexCoord2f(1, 0);
|
||||||
@ -189,7 +190,7 @@ void Engine::Render(float elapsedTime)
|
|||||||
glTexCoord2f(0, 1);
|
glTexCoord2f(0, 1);
|
||||||
glVertex3f(0.5f, 0.5f, -0.5f);
|
glVertex3f(0.5f, 0.5f, -0.5f);
|
||||||
|
|
||||||
glNormal3f(-1, 0, 0);
|
glNormal3f(0, -1, 0);
|
||||||
glTexCoord2f(0, 0);
|
glTexCoord2f(0, 0);
|
||||||
glVertex3f(-0.5f, -0.5f, -0.5f);
|
glVertex3f(-0.5f, -0.5f, -0.5f);
|
||||||
glTexCoord2f(1, 0);
|
glTexCoord2f(1, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user