Ishu_15hu

Glut Project

Sep 25th, 2021 (edited)
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 15.68 KB | None | 0 0
  1. #include<windows.h>
  2. #include<mmsystem.h>
  3. #include<GL\glut.h>
  4. #include <GL/glu.h>
  5. #include<math.h>
  6. #include <stdlib.h>
  7. #include<stdio.h>
  8.  
  9. #define PI 3.1416
  10.  
  11. GLint i, j, k,x=0,y=0,speed=0,alt=0,n1=1000,n2=1100,s1=0,s2=1,s3=1;
  12. GLfloat sun_spin=0, sun_x=0, sun_y=0,reduce=10;
  13. GLfloat ax=0,bx=0,cx=0,dx=0,str=500.0,mn=500.0;
  14. GLfloat sr=0.0,sg=0.749,sb=1.0;
  15. GLfloat spin = 0.0;
  16.  
  17. bool condition=false;
  18. GLfloat position = 0.0f;
  19. GLfloat _move =5.0f;
  20. GLfloat position1 = 0.0f;
  21. GLfloat _move1 =3.0f;
  22. GLfloat position2 = 900.0f;
  23. GLfloat _move2 =3.0f;
  24.  
  25.  
  26.  
  27.  
  28. void init(void)
  29. {
  30.     glClearColor(.40, .110, 1.0, 0.0);
  31.     glMatrixMode(GL_PROJECTION);
  32.     gluOrtho2D(0.0, 1000.0, 0.0, 700.0);
  33. }
  34.  
  35. float r(int a){
  36.  
  37. return x=4,y=8;
  38.  
  39.  
  40. }
  41.  
  42.  
  43. float r(int a,int b){
  44.  
  45.  
  46.     return x=0,y=0;
  47.  
  48. }
  49.  
  50.  
  51.  
  52. void updatey(int value) {
  53.  
  54.         y= 8.0f;
  55.  
  56.  
  57.     glutPostRedisplay();
  58.     glutTimerFunc(100, updatey, 0);
  59. }
  60.  
  61.  
  62.  
  63. void updatex(int value) {
  64.  
  65.         x=4.0f;
  66.  
  67.  
  68.     glutPostRedisplay();
  69.     glutTimerFunc(100, updatex, 0);
  70. }
  71.  
  72.  
  73. ///============================================================================================================///
  74.  
  75. ///=================///
  76. ///*** All_Model ***///
  77. ///=================///
  78.  
  79.  
  80. /*void sound()
  81. {
  82.  
  83.     PlaySound(TEXT("fire.wav"), NULL, SND_ASYNC|SND_FILENAME);
  84.  
  85.  
  86. }*/
  87.  
  88. ///*** Circle_Model***///
  89.  
  90.  
  91.  
  92. void circle(GLdouble rad)
  93. {
  94.    glBegin(GL_POLYGON);
  95.     {
  96.         for(int i=0;i<50;i++)
  97.         {
  98.  
  99.             float pi=3.1416;
  100.             float A=(i*2*pi)/50;
  101.             float r=rad;
  102.             float x = r * cos(A);
  103.  
  104.             float y = r * sin(A);
  105.             glVertex2f(x,y );
  106.         }
  107.     }
  108.     glEnd();
  109. }
  110.  
  111.  
  112.  
  113.  
  114.  
  115. void circle1(GLdouble rad)
  116. {
  117.  
  118.     glBegin(GL_POLYGON);
  119.     {
  120.         for(int i=0;i<200;i++)
  121.         {
  122.  
  123.             float pi=3.1416;
  124.             float A=(i*2*pi)/200;
  125.             float r=rad;
  126.             float x = r * cos(A);
  127.  
  128.             float y = r+10 * sin(A);
  129.             glVertex2f(x,y );
  130.         }
  131.     }
  132.     glEnd();
  133. }
  134.  
  135.  
  136.  
  137. /// *** Sun_Model **///
  138. void Sun_Model(){
  139.  
  140.     glPushMatrix();
  141.     glTranslatef(600,1100,0);
  142.     circle(33);
  143.     glPopMatrix();
  144.  
  145. }
  146.  
  147. void update2(int value) {
  148.  
  149.     //position2 -= 5;
  150.     if(position2 <-1.3)
  151.     {
  152.         position2 -= _move2;
  153.     }
  154.     glutPostRedisplay(); //Notify GLUT that the display has changed
  155.  
  156.     glutTimerFunc(20, update2, 0); //Notify GLUT to call update again in 25 milliseconds
  157. }
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166. ///*** Cloud_Model***///
  167. void cloud_model_one(){
  168.  
  169.     glColor3f(1.25, 0.924, 0.930);
  170.  
  171.     ///Top_Left
  172.  
  173.     glPushMatrix();
  174.     glTranslatef(320,210,0);
  175.     circle(15);
  176.     glPopMatrix();
  177.  
  178.     ///Top
  179.  
  180.     glPushMatrix();
  181.     glTranslatef(340, 225, 0);
  182.     circle(16);
  183.     glPopMatrix();
  184.  
  185.     ///Right
  186.  
  187.     glPushMatrix();
  188.     glTranslatef(360,210,0);
  189.     circle(16);
  190.     glPopMatrix();
  191.  
  192.  
  193.     ///middle_Fill
  194.     glPushMatrix();
  195.     glTranslatef(355,210,0);
  196.     circle(16);
  197.     glPopMatrix();
  198.  
  199.     glPushMatrix();
  200.     glTranslatef(350,210,0);
  201.     circle(16);
  202.     glPopMatrix();
  203.  
  204.     glPushMatrix();
  205.     glTranslatef(345,204,0);
  206.     circle(10);
  207.     glPopMatrix();
  208.  
  209.     glPushMatrix();
  210.     glTranslatef(340,204,0);
  211.     circle(10);
  212.     glPopMatrix();
  213.  
  214.     glPushMatrix();
  215.     glTranslatef(335,204,0);
  216.     circle(10);
  217.     glPopMatrix();
  218.  
  219.     glPushMatrix();
  220.     glTranslatef(330,204,0);
  221.     circle(10);
  222.     glPopMatrix();
  223.  
  224.     glPushMatrix();
  225.     glTranslatef(325,204,0);
  226.     circle(10);
  227.     glPopMatrix();
  228.  
  229.     glPushMatrix();
  230.     glTranslatef(320,204,0);
  231.     circle(10);
  232.     glPopMatrix();
  233.  
  234.     glPushMatrix();
  235.     glTranslatef(315,204,0);
  236.     circle(10);
  237.     glPopMatrix();
  238.  
  239.     glPushMatrix();
  240.     glTranslatef(310,204,0);
  241.     circle(10);
  242.     glPopMatrix();
  243.  
  244.     glPushMatrix();
  245.     glTranslatef(305,204,0);
  246.     circle(10);
  247.     glPopMatrix();
  248.  
  249.     ///****Fill End****
  250.  
  251. }
  252.  
  253. void cloud_model_Two(){
  254.     glColor3f(1.25, 0.924, 0.930);
  255.  
  256.     ///Left_Part
  257.     glPushMatrix();
  258.     glTranslatef(305,205,0);
  259.     circle(10);
  260.     glPopMatrix();
  261.  
  262.     ///Top
  263.  
  264.     glPushMatrix();
  265.     glTranslatef(320,210,0);
  266.     circle(15);
  267.     glPopMatrix();
  268.  
  269.     ///Right_Part
  270.     glPushMatrix();
  271.     glTranslatef(334,207,0);
  272.     circle(10);
  273.     glPopMatrix();
  274.  
  275.     ///Bottom_Part
  276.     glPushMatrix();
  277.     glTranslatef(320,207,0);
  278.     circle(10);
  279.     glPopMatrix();
  280.  
  281.  
  282.  
  283. }
  284.  
  285. void cloud_model_Three(){
  286.     glColor3f(1.25, 0.924, 0.930);
  287.  
  288.     ///Left_Part
  289.     glPushMatrix();
  290.     glTranslatef(300,200,0);
  291.     circle(15);
  292.     glPopMatrix();
  293.  
  294.     ///Top_Left
  295.  
  296.     glPushMatrix();
  297.     glTranslatef(320,210,0);
  298.     circle(15);
  299.     glPopMatrix();
  300.  
  301.     ///Top
  302.     glPushMatrix();
  303.     glTranslatef(340,220,0);
  304.     circle(16);
  305.     glPopMatrix();
  306.  
  307.     ///Top_Right
  308.     glPushMatrix();
  309.     glTranslatef(360,210,0);
  310.     circle(15);
  311.     glPopMatrix();
  312.  
  313.     ///Right_Part
  314.     glPushMatrix();
  315.     glTranslatef(380,200,0);
  316.     circle(15);
  317.     glPopMatrix();
  318.  
  319.     ///Bottom_Right
  320.     glPushMatrix();
  321.     glTranslatef(360,190,0);
  322.     circle(20);
  323.     glPopMatrix();
  324.  
  325.     ///Bottom_Left
  326.     glPushMatrix();
  327.     glTranslatef(320,190,0);
  328.     circle(20);
  329.     glPopMatrix();
  330.  
  331.     ///Bottom
  332.     glPushMatrix();
  333.     glTranslatef(340,190,0);
  334.     circle(20);
  335.     glPopMatrix();
  336.  
  337.  
  338.  
  339.  
  340.     ///****Fill End****
  341.  
  342. }
  343.  
  344.  
  345.  
  346.  
  347.  
  348. ///*** House_Model ***///
  349. void house2(){
  350.  
  351.     glPushMatrix();
  352.     glTranslatef(100, 170,0); //deploy Postition
  353.     glScalef(0.18,0.35,0);
  354.  
  355.  
  356.  
  357. glBegin(GL_QUADS);              // Each set of 4 vertices form a quad
  358.     glColor3ub(0.0f, 128.0f, 128.0f); // Red
  359.     glVertex2f(150.0f, 30.0f);    // x, y
  360.     glVertex2f(150.0f, 200.0f);    // x, y
  361.     glVertex2f(450.0f, 200.0f);
  362.     glVertex2f(450.0f, 30.0f);
  363.     glEnd();
  364.  
  365.  
  366. glBegin(GL_POLYGON);              // Each set of 4 vertices form a quad
  367.     glColor3ub(165.0f, 42.0f, 42.0f); // Red
  368.     glVertex2f(100.0f, 200.0f);    // x, y
  369.     glVertex2f(300.0f, 300.0f);    // x, y
  370.     glVertex2f(500.0f, 200.0f);
  371.  
  372.     glEnd();
  373.  
  374.     glBegin(GL_QUADS);              // Each set of 4 vertices form a quad
  375.     glColor3ub(128.0f, 0.0f, 0.0f); // Red
  376.     glVertex2f(250.0f, 30.0f);    // x, y
  377.     glVertex2f(250.0f, 120.0f);    // x, y
  378.     glVertex2f(320.0f, 120.0f);
  379.     glVertex2f(320.0f, 30.0f);
  380.     glEnd();
  381.  
  382.     glBegin(GL_QUADS);              // Each set of 4 vertices form a quad
  383.     glColor3ub(128.0f, 0.0f, 0.0f); // Red
  384.     glVertex2f(350.0f, 120.0f);    // x, y
  385.     glVertex2f(350.0f, 145.0f);    // x, y
  386.     glVertex2f(395.0f, 145.0f);
  387.     glVertex2f(395.0f, 120.0f);
  388.     glEnd();
  389.  
  390.  
  391.  
  392.     glBegin(GL_QUADS);              // Each set of 4 vertices form a quad
  393.     glColor3ub(128.0f, 0.0f, 0.0f); // Red
  394.     glVertex2f(175.0f, 120.0f);    // x, y
  395.     glVertex2f(175.0f, 145.0f);    // x, y
  396.     glVertex2f(220.0f, 145.0f);
  397.     glVertex2f(220.0f, 120.0f);
  398.     glEnd();
  399.  
  400.     glPopMatrix();
  401. }
  402.  
  403.  
  404. void house1(){
  405.  
  406.     glPushMatrix();
  407.     glTranslatef(440, 230,0);
  408.     glScalef(0.18,0.35,0);
  409.  
  410.  
  411.  
  412. glBegin(GL_QUADS);              // Each set of 4 vertices form a quad
  413.     glColor3ub(0.0f, 128.0f, 128.0f); // Red
  414.     glVertex2f(150.0f, 30.0f);    // x, y
  415.     glVertex2f(150.0f, 200.0f);    // x, y
  416.     glVertex2f(450.0f, 200.0f);
  417.     glVertex2f(450.0f, 30.0f);
  418.     glEnd();
  419.  
  420.  
  421. glBegin(GL_POLYGON);              // Each set of 4 vertices form a quad
  422.     glColor3ub(165.0f, 42.0f, 42.0f); // Red
  423.     glVertex2f(100.0f, 200.0f);    // x, y
  424.     glVertex2f(300.0f, 300.0f);    // x, y
  425.     glVertex2f(500.0f, 200.0f);
  426.  
  427.     glEnd();
  428.  
  429.     glBegin(GL_QUADS);              // Each set of 4 vertices form a quad
  430.     glColor3ub(128.0f, 0.0f, 0.0f); // Red
  431.     glVertex2f(250.0f, 30.0f);    // x, y
  432.     glVertex2f(250.0f, 120.0f);    // x, y
  433.     glVertex2f(320.0f, 120.0f);
  434.     glVertex2f(320.0f, 30.0f);
  435.     glEnd();
  436.  
  437.     glBegin(GL_QUADS);              // Each set of 4 vertices form a quad
  438.     glColor3ub(128.0f, 0.0f, 0.0f); // Red
  439.     glVertex2f(350.0f, 120.0f);    // x, y
  440.     glVertex2f(350.0f, 145.0f);    // x, y
  441.     glVertex2f(395.0f, 145.0f);
  442.     glVertex2f(395.0f, 120.0f);
  443.     glEnd();
  444.  
  445.  
  446.  
  447.     glBegin(GL_QUADS);              // Each set of 4 vertices form a quad
  448.     glColor3ub(128.0f, 0.0f, 0.0f); // Red
  449.     glVertex2f(175.0f, 120.0f);    // x, y
  450.     glVertex2f(175.0f, 145.0f);    // x, y
  451.     glVertex2f(220.0f, 145.0f);
  452.     glVertex2f(220.0f, 120.0f);
  453.     glEnd();
  454.  
  455.     glPopMatrix();
  456. }
  457.  
  458. void house3(){
  459.  
  460.     glPushMatrix();
  461.     glTranslatef(240, 385,0);
  462.     glScalef(0.18,0.35,0);
  463.  
  464.  
  465.  
  466. glBegin(GL_QUADS);              // Each set of 4 vertices form a quad
  467.     glColor3ub(0.0f, 128.0f, 128.0f); // Red
  468.     glVertex2f(150.0f, 30.0f);    // x, y
  469.     glVertex2f(150.0f, 200.0f);    // x, y
  470.     glVertex2f(450.0f, 200.0f);
  471.     glVertex2f(450.0f, 30.0f);
  472.     glEnd();
  473.  
  474.  
  475. glBegin(GL_POLYGON);              // Each set of 4 vertices form a quad
  476.     glColor3ub(165.0f, 42.0f, 42.0f); // Red
  477.     glVertex2f(100.0f, 200.0f);    // x, y
  478.     glVertex2f(300.0f, 300.0f);    // x, y
  479.     glVertex2f(500.0f, 200.0f);
  480.  
  481.     glEnd();
  482.  
  483.     glBegin(GL_QUADS);              // Each set of 4 vertices form a quad
  484.     glColor3ub(128.0f, 0.0f, 0.0f); // Red
  485.     glVertex2f(250.0f, 30.0f);    // x, y
  486.     glVertex2f(250.0f, 120.0f);    // x, y
  487.     glVertex2f(320.0f, 120.0f);
  488.     glVertex2f(320.0f, 30.0f);
  489.     glEnd();
  490.  
  491.     glBegin(GL_QUADS);              // Each set of 4 vertices form a quad
  492.     glColor3ub(128.0f, 0.0f, 0.0f); // Red
  493.     glVertex2f(350.0f, 120.0f);    // x, y
  494.     glVertex2f(350.0f, 145.0f);    // x, y
  495.     glVertex2f(395.0f, 145.0f);
  496.     glVertex2f(395.0f, 120.0f);
  497.     glEnd();
  498.  
  499.  
  500.  
  501.     glBegin(GL_QUADS);              // Each set of 4 vertices form a quad
  502.     glColor3ub(128.0f, 0.0f, 0.0f); // Red
  503.     glVertex2f(175.0f, 120.0f);    // x, y
  504.     glVertex2f(175.0f, 145.0f);    // x, y
  505.     glVertex2f(220.0f, 145.0f);
  506.     glVertex2f(220.0f, 120.0f);
  507.     glEnd();
  508.  
  509.     glPopMatrix();
  510. }
  511.  
  512.  
  513.  
  514.  
  515.  
  516. ///*** Field_Model ***///
  517. void field(){
  518.     ///Field
  519.     glBegin(GL_POLYGON);
  520.     glColor3ub(0, 153, 51);
  521.  
  522.     glVertex2i(0, 30);
  523.     glVertex2i(0, 440);
  524.     glVertex2i(1000, 440);
  525.     glVertex2i(1000, 420);
  526.  
  527.     glEnd();
  528.  
  529.  
  530.  
  531.      ///river
  532.  
  533.     glBegin(GL_POLYGON);
  534.     glColor3ub(0, 143, 179);
  535.     glVertex2i(0,0);
  536.     glVertex2i(0,30);
  537.     glVertex2i(1000,420);
  538.     glVertex2i(1000,0);
  539.  
  540.     glEnd();
  541.  
  542. }
  543.                   ///Boat///////////////*****************
  544. void Boat(){
  545.  
  546.  
  547.         glPushMatrix();
  548.         glTranslatef(position,0.0f,0.0f);
  549.         glTranslatef(770,40.0f,0.0f);
  550.  
  551. glBegin(GL_POLYGON);
  552.     glColor3f(0.0, 0.0, 0.0);
  553.     glVertex2i(225,75);
  554.     glVertex2i(175, 100);
  555.     glVertex2i(325,100);
  556.     glVertex2i(275,75);
  557.  
  558.  
  559. glEnd();
  560.  
  561.  
  562. glBegin(GL_POLYGON);
  563.     glColor3ub(165.0, 42.0, 42.0);
  564.     glVertex2i(220,100);
  565.     glVertex2i(220, 130);
  566.     glVertex2i(280,130);
  567.     glVertex2i(280,100);
  568.  
  569.  
  570. glEnd();
  571.  
  572.  
  573.     glPopMatrix();
  574.  
  575. }
  576.  
  577. void update(int value) {
  578.  
  579.  
  580.     if(position <-700.0)
  581.         _move = -5.0f;
  582.  
  583.       else if(position >230.0)
  584.         _move = 5.0f;
  585.  
  586.     position -= _move;
  587.  
  588.     glutPostRedisplay();
  589.  
  590.  
  591.     glutTimerFunc(50, update, 0);
  592. }
  593.  
  594.  
  595. ///*** Tree_Model ***///
  596.  
  597.  
  598. void Tree_Model(){
  599.  
  600.  
  601.     glBegin(GL_POLYGON);
  602.     glVertex2f(110, 153);
  603.     glVertex2f(133, 215);
  604.     glVertex2f(156, 153);
  605.  
  606.     glEnd();
  607.  
  608.     glBegin(GL_POLYGON);
  609.     glColor3ub(27, 38, 49);
  610.     glVertex2f(130, 120);
  611.     glVertex2f(130, 154);
  612.     glVertex2f(136, 154);
  613.     glVertex2f(136, 120);
  614.  
  615.     glEnd();
  616. }
  617.  
  618. void update1(int value) {
  619.  
  620.  
  621.     if(position1 <-650.0)
  622.         position1 = 1200.0f;
  623.  
  624.     position1 -= _move1;
  625.  
  626.     glutPostRedisplay();
  627.  
  628.  
  629.     glutTimerFunc(22, update1, 0);
  630. }
  631.  
  632.  
  633. void cloud_three(){
  634.     glPushMatrix();
  635.     glColor3ub(46, 204, 13.0);
  636.     glTranslatef(position1,0,0);
  637.     glTranslatef(180,330,0);
  638.     cloud_model_Three();
  639.     glPopMatrix();
  640.  
  641. }
  642. ///*** Cloud_Four_Model_Two ***///
  643. void cloud_four(){
  644.     glPushMatrix();
  645.     glTranslatef(position1,0,0);
  646.     glTranslatef(300,275,0);
  647.     cloud_model_Two();
  648.     glPopMatrix();
  649.  
  650. }
  651.  
  652. void star(){
  653. if ( condition==true)
  654.  
  655. {
  656.   glBegin(GL_POINTS);              // Each set of 4 vertices form a quad
  657.     glColor3ub(247, 249, 249); // Red
  658.            glVertex2f(500.1f, 500.3f);    // x, y
  659.         glVertex2f( 550.1f, 504.0f);
  660.  
  661.  
  662.             glVertex2f( 150.1f, 504.0f);
  663.  
  664.              glVertex2f( 310.1f, 504.0f);
  665.  
  666.             glVertex2f( 261.0f, 505.0f);
  667.  
  668.             glVertex2f( 453.1f, 506.0f);
  669.  
  670.             glVertex2f( 616.1f, 507.0f);
  671.  
  672.             glVertex2f( 763.1f, 508.0f);
  673.  
  674.              glVertex2f( 587.1f, 524.0f);
  675.  
  676.              glVertex2f( 954.1f, 574.0f);
  677.  
  678.             glVertex2f( 231.1f, 585.0f);
  679.  
  680.             glVertex2f( 275.1f, 566.0f);
  681.  
  682.             glVertex2f( 852.1f, 557.0f);
  683.  
  684.             glVertex2f( 476.1f, 548.0f);
  685.  
  686.  
  687.  
  688.  
  689.             glVertex2f( 140.1f, 509.0f);
  690.             glVertex2f( 350.1f, 510.0f);
  691.  
  692.             glVertex2f( 061.1f, 511.0f);
  693.  
  694.             glVertex2f( 463.1f, 512.0f);
  695.  
  696.             glVertex2f( 822.1f, 513.0f);
  697.  
  698.             glVertex2f( 110.1f, 514.0f);
  699.  
  700.             glVertex2f( 966.1f, 515.0f);
  701.  
  702.             glVertex2f( 211.1f, 516.0f);
  703.  
  704.             glVertex2f( 313.1f, 517.0f);
  705.  
  706.             glVertex2f( 869.1f, 518.0f);
  707.  
  708.             glVertex2f( 639.1f, 519.0f);
  709.  
  710.             glVertex2f( 106.1f, 520.0f);
  711.  
  712.  
  713.  
  714.  
  715.  
  716.             glVertex2f( 140.1f, 709.0f);
  717.             glVertex2f( 350.1f, 810.0f);
  718.  
  719.             glVertex2f( 061.1f, 911.0f);
  720.  
  721.             glVertex2f( 463.1f, 412.0f);
  722.             glVertex2f( 822.1f, 713.0f);
  723.  
  724.             glVertex2f( 110.1f, 614.0f);
  725.  
  726.             glVertex2f( 966.1f, 815.0f);
  727.  
  728.             glVertex2f( 211.1f, 916.0f);
  729.  
  730.             glVertex2f( 313.1f, 1017.0f);
  731.  
  732.             glVertex2f( 869.1f, 718.0f);
  733.  
  734.             glVertex2f( 639.1f, 919.0f);
  735.  
  736.             glVertex2f( 106.1f, 902.0f);
  737.              glVertex2f( 106.1f, 908.0f);
  738.  glVertex2f( 106.1f, 620.0f);
  739.  glVertex2f( 250.1f, 630.0f);
  740.  glVertex2f( 106.1f, 906.0f);
  741.  glVertex2f( 116.1f, 530.0f);
  742.  glVertex2f( 980.1f, 980.0f);
  743.   glVertex2f( 900.1f, 930.0f);
  744.  glVertex2f( 858.1f, 666.0f);
  745.  glVertex2f( 845.1f, 642.0f);
  746.  glVertex2f( 900.1f, 900.0f);
  747.  glVertex2f( 910.1f, 903.0f);
  748.  glVertex2f( 915.1f, 908.0f);
  749.  glVertex2f( 919.1f, 920.0f);
  750.  glVertex2f( 930.1f, 903.0f);
  751.  glVertex2f( 935.1f, 905.0f);
  752.  glVertex2f( 940.1f, 905.0f);
  753.   glVertex2f( 945.1f, 910.0f);
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760. glVertex2f( 600.1f, 525.0f);
  761.  
  762.  
  763.  
  764.     glVertex2f( 650.1f, 535.0f);
  765.  
  766.     glVertex2f( 690.1f, 490.0f);
  767. glVertex2f( 550.1f, 600.0f);
  768. glVertex2f( 500.1f, 600.0f);
  769.  
  770.  
  771.  
  772.  
  773.  
  774.     glEnd();
  775.  
  776. }
  777.  
  778.  
  779.  
  780. }
  781.  
  782. bool con(){
  783. return condition=true;
  784. }
  785. ///*** Tree_10 ***///
  786. void Tree_Ten(){
  787.      glColor3ub(46, 204, 13.0);
  788.     glPushMatrix();
  789.     glTranslatef(-20,90,0);//-2
  790.     Tree_Model();
  791.     glPopMatrix();
  792. }
  793.  
  794. ///*** Tree_11 ***///
  795. void Tree_Eleven(){
  796.      glColor3ub(46, 204, 13.0);
  797.     glPushMatrix();
  798.     glTranslatef(125,200,0);
  799.     Tree_Model();
  800.     glPopMatrix();
  801. }
  802.  
  803. ///*** Tree_12 ***///
  804. void Tree_Twelve(){
  805.      glColor3ub(46, 204, 13.0);
  806.     glPushMatrix();
  807.     glTranslatef(408,178,0);//-22
  808.     Tree_Model();
  809.     glPopMatrix();
  810. }
  811.  
  812.  
  813.  
  814. void tree(){
  815.  
  816.  
  817.     glColor3f(0.11, 0.23, 0.36);
  818.     glPushMatrix();
  819.     glTranslatef(-120,-110,0);//-90;
  820.     glPopMatrix();
  821.  
  822. }
  823.  
  824.  
  825.  
  826. ///Object_End
  827. ///=========================================================================================================///
  828.  
  829.  
  830. ///========================///
  831. ///*** Display Function ***///
  832. ///========================///
  833.  
  834. void display(void)
  835. {
  836.     glClear(GL_COLOR_BUFFER_BIT);
  837.     glColor3f(0.0, 0.0, 1.0);
  838.  
  839.     cloud_three();
  840.     cloud_four();
  841.  
  842.     field();
  843.     Tree_Ten();
  844.     Tree_Eleven();
  845.     Tree_Twelve();
  846.     house2();//This one
  847.     house1();
  848.     house3();
  849.  
  850.     Boat();
  851.  
  852.     glFlush();
  853. }
  854.  
  855.  
  856. int main(int argc, char** argv)
  857. {
  858.     glutInit(&argc, argv);
  859.     glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
  860.     glutInitWindowPosition(50, 50);
  861.     glutInitWindowSize(1800, 900);
  862.     glutCreateWindow("CODE_GREEN");
  863.     init();
  864.  
  865.     glutDisplayFunc(display);
  866.  
  867.     glutTimerFunc(20, update, 0);
  868.     glutTimerFunc(20, update1, 0);
  869.     glutMainLoop();
  870. }
  871.  
Add Comment
Please, Sign In to add comment