Advertisement
naeem043

chess

Jan 2nd, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.49 KB | None | 0 0
  1. //#include <GL/glut.h>
  2. //
  3. //void shapes (void) {
  4. //
  5. //  glBegin(GL_QUADS);
  6. //  glColor3f(.1, .8, 1);
  7. //  glVertex3f(-1.3, -1.25, 0.0);
  8. //  glVertex3f(-1.3, 1.25, 0.0);
  9. //  glVertex3f(1.3, 1.25, 0.0);
  10. //  glVertex3f(1.3, -1.25, 0.0);
  11. //  glEnd();
  12. //
  13. //  double w1=1.0,w2=0.75,l1=1.0,l2=0.75;
  14. //  int i,j;
  15. //  for(i=1;i<9;i++)
  16. //  {
  17. //      for(j=1;j<9;j++)
  18. //      {
  19. //          glBegin(GL_QUADS);
  20. //
  21. //          if(i%2==0)
  22. //          {
  23. //              if(j%2==0)
  24. //              {
  25. //                  glColor3f(1.0, 1.0, 1.0);
  26. //              }
  27. //              else
  28. //              {
  29. //                  glColor3f(0.0, 0.0, 0.0);
  30. //              }
  31. //          }
  32. //
  33. //          else
  34. //              if(j%2==0)
  35. //              {
  36. //                  glColor3f(0.0, 0.0, 0.0);
  37. //              }
  38. //              else
  39. //              {
  40. //                  glColor3f(1.0, 1.0, 1.0);
  41. //              }          
  42. //          glVertex3f(w1,l1,0.0);
  43. //          glVertex3f(w2,l1,0.0);
  44. //          glVertex3f(w2,l2,0.0);
  45. //          glVertex3f(w1,l2,0.0);
  46. //          glEnd();
  47. //          w1=w1-0.25;
  48. //          w2=w1-0.25;
  49. //      }
  50. //      w1=1;
  51. //      w2=.75;
  52. //      l1=l1-0.25;
  53. //      l2=l2-0.25;
  54. //  }
  55. //
  56. //}
  57. //
  58. //void display (void) {
  59. //
  60. //   //clearing the window with black color, 1st 3 parameter are for R,G,B. last one for opacity
  61. //  glClearColor (0.0,0.0,0.0,1.0);
  62. //    glClear (GL_COLOR_BUFFER_BIT);
  63. //    glLoadIdentity();  
  64. //       //viewing transformation
  65. //  //glulookat(); positions the camera towards the object
  66. //  //camera position, camera target, upvector
  67. //    gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
  68. //  shapes();
  69. //  glFlush();
  70. //}
  71. //
  72. //void reshape (int w, int h) {
  73. //
  74. //   //1st 2 parameters for lower left corner of the viewport rectangle. the default is 0,0
  75. //   //the next coordinates are width and hight of the viewport
  76. ////Set the viewport to be the entire window
  77. //  glViewport (0, 0, (GLsizei)w, (GLsizei)h);
  78. //
  79. //   //setting the camera
  80. //  glMatrixMode (GL_PROJECTION);
  81. //  glLoadIdentity ();  
  82. //
  83. //  //perspective transform
  84. //  gluPerspective (30, (GLfloat)w / (GLfloat)h, 1.0, 100.0);
  85. //  gluPerspective (30, 1, 1.0, 100.0);
  86. //  glMatrixMode (GL_MODELVIEW); //switch back the the model editing mode.
  87. //
  88. //}
  89. //
  90. //int main (int argc, char **argv) {
  91. //    glutInit (&argc, argv);
  92. //  glutInitDisplayMode (GLUT_SINGLE); // single buffering.. (double buffering for animation)
  93. //   //full screen is 1000,1000
  94. //   //this 0,0 or 1000,1000 are world co ordinates
  95. //  glutInitWindowSize (700, 700);
  96. //  glutInitWindowPosition (100, 100);
  97. //    glutCreateWindow ("Chess Board");
  98. //   //registering callback functions
  99. //    glutDisplayFunc (display);  
  100. //  glutReshapeFunc (reshape);
  101. // 
  102. //    glutMainLoop ();
  103. //    return 0;
  104. //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement