Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#include <GL/glut.h>
- //
- //void shapes (void) {
- //
- // glBegin(GL_QUADS);
- // glColor3f(.1, .8, 1);
- // glVertex3f(-1.3, -1.25, 0.0);
- // glVertex3f(-1.3, 1.25, 0.0);
- // glVertex3f(1.3, 1.25, 0.0);
- // glVertex3f(1.3, -1.25, 0.0);
- // glEnd();
- //
- // double w1=1.0,w2=0.75,l1=1.0,l2=0.75;
- // int i,j;
- // for(i=1;i<9;i++)
- // {
- // for(j=1;j<9;j++)
- // {
- // glBegin(GL_QUADS);
- //
- // if(i%2==0)
- // {
- // if(j%2==0)
- // {
- // glColor3f(1.0, 1.0, 1.0);
- // }
- // else
- // {
- // glColor3f(0.0, 0.0, 0.0);
- // }
- // }
- //
- // else
- // if(j%2==0)
- // {
- // glColor3f(0.0, 0.0, 0.0);
- // }
- // else
- // {
- // glColor3f(1.0, 1.0, 1.0);
- // }
- // glVertex3f(w1,l1,0.0);
- // glVertex3f(w2,l1,0.0);
- // glVertex3f(w2,l2,0.0);
- // glVertex3f(w1,l2,0.0);
- // glEnd();
- // w1=w1-0.25;
- // w2=w1-0.25;
- // }
- // w1=1;
- // w2=.75;
- // l1=l1-0.25;
- // l2=l2-0.25;
- // }
- //
- //}
- //
- //void display (void) {
- //
- // //clearing the window with black color, 1st 3 parameter are for R,G,B. last one for opacity
- // glClearColor (0.0,0.0,0.0,1.0);
- // glClear (GL_COLOR_BUFFER_BIT);
- // glLoadIdentity();
- // //viewing transformation
- // //glulookat(); positions the camera towards the object
- // //camera position, camera target, upvector
- // gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
- // shapes();
- // glFlush();
- //}
- //
- //void reshape (int w, int h) {
- //
- // //1st 2 parameters for lower left corner of the viewport rectangle. the default is 0,0
- // //the next coordinates are width and hight of the viewport
- ////Set the viewport to be the entire window
- // glViewport (0, 0, (GLsizei)w, (GLsizei)h);
- //
- // //setting the camera
- // glMatrixMode (GL_PROJECTION);
- // glLoadIdentity ();
- //
- // //perspective transform
- // gluPerspective (30, (GLfloat)w / (GLfloat)h, 1.0, 100.0);
- // gluPerspective (30, 1, 1.0, 100.0);
- // glMatrixMode (GL_MODELVIEW); //switch back the the model editing mode.
- //
- //}
- //
- //int main (int argc, char **argv) {
- // glutInit (&argc, argv);
- // glutInitDisplayMode (GLUT_SINGLE); // single buffering.. (double buffering for animation)
- // //full screen is 1000,1000
- // //this 0,0 or 1000,1000 are world co ordinates
- // glutInitWindowSize (700, 700);
- // glutInitWindowPosition (100, 100);
- // glutCreateWindow ("Chess Board");
- // //registering callback functions
- // glutDisplayFunc (display);
- // glutReshapeFunc (reshape);
- //
- // glutMainLoop ();
- // return 0;
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement