Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

problem with drawing a 3d square

hi..I am new to opengl. i am trying to draw a 3d square can someone tell me wats wrong with the code


void myGlutDisplay(void)
{
// glClearColor(1.0,1.0,1.0,1.0);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glColor3f(1,0,0);
glBegin(GL_POLYGONS)
glVertex3f(250,250,1);
glVertex3f(280,250,1);
glVertex3f(280,280,1);
glVertex3f(250,280,1);
glEnd();
glFlush();
glutSwapBuffers();

}

int main(int argc, char **argv)
{

// setup glut
glutInit(&argc, argv);
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutInitWindowPosition( 50, 50 );
glutInitWindowSize( WIN_WIDTH, WIN_HEIGHT);



// Initialize my Scene
initScene();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0,500,0,500,-1,60);
glMatrixMode(GL_MODELVIEW);


glutMainLoop();
return EXIT_SUCCESS;
}



Sign In or Register to comment.