fix push & pop matrix

This commit is contained in:
2023-11-19 08:30:14 -05:00
parent 4ab73a137f
commit c85adb2a55
3 changed files with 4 additions and 6 deletions

View File

@@ -58,9 +58,10 @@ void pre_render() {
}
void render() {
entityList.getSkybox()->render();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
entityList.getCamera()->render();
glTranslatef(0.0f, 0.0f, 0.0f);
entityList.getSkybox()->render();
glPushMatrix();
glBegin(GL_QUADS);
glColor3f(1,0.5,1);
@@ -101,7 +102,6 @@ void render() {
glVertex3f(-0.5f, -0.5f, 0.5f);
glEnd();
glPopMatrix();
glPushMatrix();
//glBegin(GL_QUADS);

View File

@@ -94,8 +94,6 @@ public:
}
void render() {
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
//glTranslatef(-position.x, -position.y, -position.z);
// up vector
glRotatef(-angles.x,1.0f, 0.0f, 0.0f);

View File

@@ -48,7 +48,7 @@ public:
glColor3f(1,0,0);
glTranslatef(position.x,position.y+10,position.z);
glBegin(GL_QUADS);
glColor3f(1,0.5,1);
glColor3f(1,0,0);
// Front face
glVertex3f(-0.5f, -0.5f, 0.5f);
glVertex3f(0.5f, -0.5f, 0.5f);