Advertisement
naeem043

House

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