Object disapear/don't scale in the Z-AXIS of OPENGL.

Posted by user315684 on Stack Overflow See other posts from Stack Overflow or by user315684
Published on 2010-04-13T16:14:26Z Indexed on 2010/06/18 15:03 UTC
Read the original article Hit count: 151

Filed under:

This code is susposed to have a QUAD orbit around a center point in basically a circle. The problem is while it does the X rotation fine it disapears when it moves in Z axis and doesn't appear to change in size. It feel like it's rendering everything in Orthagraphic view or something.

This is my first OpenGL project.

OPENGL CODE START HERE

        glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
        glClear(GL_COLOR_BUFFER_BIT);
        glMatrixMode (GL_PROJECTION);

        glPushMatrix();
       //glRotatef(theta, 0.0f, 0.0f, 1.0f);
       glScalef(0.75f, 0.75f, 0.75f);
       glTranslatef(planeX, -0.0f, 0.0f);

        glBegin(GL_QUADS);
            glColor3f(1.0f, 0.0f, 0.0f);   glVertex3f(0.0f,   0.0f, planeZ);
            glColor3f(0.0f, 1.0f, 0.0f);   glVertex3f(0.0f,   1.0f, planeZ);
            glColor3f(0.0f, 0.0f, 1.0f);   glVertex3f(1.0f,   1.0f, planeZ);
            glColor3f(0.0f, 0.0f, 1.0f);   glVertex3f(1.0f,   0.0f, planeZ);
        glEnd();

        glPopMatrix();

        SwapBuffers(hDC);

        theta += 1.0f;

        planeX = (sin(0.0314159265f*theta));
        planeZ = (cos(0.0314159265f*theta));
        Sleep (1);

ENDS HERE

© Stack Overflow or respective owner

Related posts about opengl