Advertisement
Guest User

assim

a guest
Mar 22nd, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 16.39 KB | None | 0 0
  1. #include <windows.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <math.h>
  5. #include <GL/glut.h>
  6.  
  7. //--------------------------------- Definir cores
  8. #define BLUE     0.0, 0.0, 1.0, 1.0
  9. #define RED      1.0, 0.0, 0.0, 1.0
  10. #define YELLOW   1.0, 1.0, 0.0, 1.0
  11. #define GREEN    0.0, 1.0, 0.0, 1.0
  12. #define WHITE    1.0, 1.0, 1.0, 1.0
  13. #define BLACK    0.0, 0.0, 0.0, 1.0
  14. #define PI       3.14159
  15.  
  16. //================================================================================
  17. //===========================================================Variaveis e constantes
  18.  
  19. //------------------------------------------------------------ Sistema Coordenadas + objectos
  20. GLint       wScreen=800, hScreen=600;       //.. janela (pixeis)
  21. GLfloat     xC=5.0, yC=5.0, zC=5.0;     //.. Mundo  (unidades mundo)
  22. GLfloat     aVisao1=0;
  23. //------------------------------------------------------------ Observador
  24. GLfloat  rVisao=200, aVisao=(0.5*PI) + 3.2, incVisao=0.05;
  25. GLfloat  obsP[] ={rVisao*cos(aVisao), 3.0, rVisao*sin(aVisao)};
  26. GLfloat  angZoom=90;
  27. GLfloat  incZoom=3;
  28.  
  29. GLdouble tx=0;
  30. GLdouble ty=0;
  31. GLdouble tz=0;
  32.  
  33. GLdouble Upx=0;
  34. GLdouble Upy=1;
  35. GLdouble Upz=0;
  36.  
  37. //=========================================================== FACES
  38. GLboolean   frenteVisivel=1;
  39.  
  40. static GLuint vert_ordem[48][4];
  41.  
  42. static GLuint faces[]= {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
  43. 31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,
  44. 67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,
  45. 103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,
  46. 131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,
  47. 161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191};
  48.  
  49.  
  50. //ESCADAS
  51. static GLfloat vertices[] =
  52. {
  53.     -50.000000, 0.000000, 0.000000, 50.000000, 0.000000, 0.000000, 50.000000, 12.000000, 0.000000, -50.000000, 12.000000, 0.000000, -50.000000, 12.000000, 20.000000, 50.000000, 12.000000, 20.000000, 50.000000, 12.000000, 0.000000, -50.000000, 12.000000, 0.000000, -50.000000, 12.000000, 20.000000, 50.000000, 12.000000, 20.000000, 50.000000, 24.000000, 20.000000, -50.000000, 24.000000, 20.000000, -50.000000, 24.000000, 40.000000, 50.000000, 24.000000, 40.000000, 50.000000, 24.000000, 20.000000, -50.000000, 24.000000, 20.000000, -50.000000, 24.000000, 40.000000, 50.000000, 24.000000, 40.000000, 50.000000, 36.000000, 40.000000, -50.000000, 36.000000, 40.000000, -50.000000, 36.000000, 60.000000, 50.000000, 36.000000, 60.000000, 50.000000, 36.000000, 40.000000, -50.000000, 36.000000, 40.000000, -50.000000, 36.000000, 60.000000, 50.000000, 36.000000, 60.000000, 50.000000, 48.000000, 60.000000, -50.000000, 48.000000, 60.000000, -50.000000, 48.000000, 80.000000, 50.000000, 48.000000, 80.000000, 50.000000, 48.000000, 60.000000, -50.000000, 48.000000, 60.000000, -50.000000, 48.000000, 80.000000, 50.000000, 48.000000, 80.000000, 50.000000, 60.000000, 80.000000, -50.000000, 60.000000, 80.000000, -50.000000, 60.000000, 100.000000, 50.000000, 60.000000, 100.000000, 50.000000, 60.000000, 80.000000, -50.000000, 60.000000, 80.000000, -50.000000, 60.000000, 100.000000, 50.000000, 60.000000, 100.000000, 50.000000, 72.000000, 100.000000, -50.000000, 72.000000, 100.000000, -50.000000, 72.000000, 120.000000, 50.000000, 72.000000, 120.000000, 50.000000, 72.000000, 100.000000, -50.000000, 72.000000, 100.000000, -50.000000, 72.000000, 140.000000, 50.000000, 72.000000, 140.000000, 50.000000, 72.000000, 120.000000, -50.000000, 72.000000, 120.000000, -50.000000, 72.000000, 160.000000, 50.000000, 72.000000, 160.000000, 50.000000, 72.000000, 140.000000, -50.000000, 72.000000, 140.000000, -50.000000, 72.000000, 180.000000, 50.000000, 72.000000, 180.000000, 50.000000, 72.000000, 160.000000, -50.000000, 72.000000, 160.000000, -50.000000, 72.000000, 200.000000, 50.000000, 72.000000, 200.000000, 50.000000, 72.000000, 180.000000, -50.000000, 72.000000, 180.000000
  54. };
  55.  
  56.  
  57. static GLfloat normais[] =
  58. {
  59.     0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000,
  60. };
  61.  
  62.  
  63. static GLfloat cores [] = {0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000,
  64. };
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. //================================================================================
  73. //=========================================================================== INIT
  74. void inicializa(void)
  75. {
  76.     glClearColor(BLACK);        //………………………………………………………………………………Apagar
  77.     glEnable(GL_DEPTH_TEST);    //………………………………………………………………………………Profundidade
  78.     glShadeModel(GL_SMOOTH);    //………………………………………………………………………………Interpolacao de cores  
  79.  
  80.     //glEnable(GL_CULL_FACE);       //………………………………………………………………………………Faces visiveis
  81.     //glCullFace(GL_BACK);      //………………………………………………………………………………Mostrar so as da frente
  82.        
  83.     glVertexPointer(3, GL_FLOAT, 0, vertices); //………………………………………Vertex arrays
  84.     glEnableClientState(GL_VERTEX_ARRAY);
  85.     glNormalPointer(GL_FLOAT, 0, normais);
  86.     glEnableClientState(GL_NORMAL_ARRAY);
  87.     glColorPointer(3, GL_FLOAT, 0, cores);
  88.     glEnableClientState(GL_COLOR_ARRAY);   
  89. }
  90.  
  91.  
  92.  
  93. void drawEixos()
  94. {  
  95.     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Eixo X
  96.     glColor4f(RED);
  97.     glBegin(GL_LINES);
  98.         glVertex3i( 0, 0, 0);
  99.         glVertex3i(10, 0, 0);
  100.     glEnd();
  101.     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Eixo Y
  102.     glColor4f(GREEN);
  103.     glBegin(GL_LINES);
  104.         glVertex3i(0,  0, 0);
  105.         glVertex3i(0, 10, 0);
  106.     glEnd();
  107.     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Eixo Z
  108.     glColor4f(BLUE);
  109.     glBegin(GL_LINES);
  110.         glVertex3i( 0, 0, 0);
  111.         glVertex3i( 0, 0,10);
  112.     glEnd();
  113.  
  114. }  
  115.  
  116. void drawSala(){
  117.     //PLano z=0
  118.     glBegin(GL_QUADS);
  119.     glColor3f(1,0,1);
  120.     glVertex3f(0,0,0);
  121.     glVertex3f(0,300,0);
  122.     glVertex3f(500,300,0);
  123.     glVertex3f(500,0,0);
  124.     glEnd();
  125.  
  126.     //Plano x=0
  127.     glBegin(GL_QUADS);
  128.     glColor3f(1,1,0);
  129.     glVertex3f(0,0,0);
  130.     glVertex3f(0,300,0);
  131.     glVertex3f(0,300,800);
  132.     glVertex3f(0,0,800);
  133.         glEnd();
  134.    
  135.     //Plano y=0
  136.     glBegin(GL_QUADS);
  137.     glColor3f(0,1,1);
  138.     glVertex3f(0,0,0);
  139.     glVertex3f(0,0,800);
  140.     glVertex3f(500,0,800);
  141.     glVertex3f(500,0,0);
  142.         glEnd();
  143.    
  144.     //Plano z=800
  145.     glBegin(GL_QUADS);
  146.     glColor3f(1,0,0);
  147.     glVertex3f(0,0,800);
  148.     glVertex3f(0,300,800);
  149.     glVertex3f(500,300,800);
  150.     glVertex3f(500,0,800);
  151.     glEnd();
  152.    
  153.    
  154.    
  155.     //Plano x=800
  156.     glBegin(GL_QUADS);
  157.     glColor3f(1,1,0);
  158.     glVertex3f(500,0,0);
  159.     glVertex3f(500,300,0);
  160.     glVertex3f(500,300,800);
  161.     glVertex3f(500,0,800);
  162.     glEnd();
  163.    
  164.    
  165.     //Plano y=800
  166.     glBegin(GL_QUADS);
  167.     glColor3f(0,1,1);
  168.     glVertex3f(0,300,0);
  169.     glVertex3f(0,300,800);
  170.     glVertex3f(500,300,800);
  171.     glVertex3f(500,300,0);
  172.         glEnd();
  173.        
  174.    
  175.     //Plano y=72
  176.     glBegin(GL_QUADS);
  177.     glColor3f(0,1,0);
  178.     glVertex3f(0,72,380);
  179.     glVertex3f(0,72,800);
  180.     glVertex3f(500,72,800);
  181.     glVertex3f(500,72,380);
  182.     glEnd();
  183. }
  184.  
  185.  
  186. void drawScene(){
  187.    
  188.     //=================================================== Qual o lado ?
  189.     /*if (frenteVisivel)
  190.         glCullFace(GL_BACK);  //glFrontFace(GL_CW);
  191.     else
  192.         glCullFace(GL_FRONT);  //glFrontFace(GL_CCW);
  193.       */  
  194.         drawSala();
  195.        
  196.        
  197.             int acum = 0;
  198.    
  199.     for (int i = 0; i < 48; i++){
  200.        
  201.         vert_ordem[i][0] = faces[acum++];
  202.         vert_ordem[i][1] = faces[acum++];
  203.         vert_ordem[i][2] = faces[acum++];
  204.         vert_ordem[i][3] = faces[acum++];
  205.     }
  206.    
  207.     glPushMatrix();
  208.         glTranslatef (50,0,200);
  209.                
  210.         for (int i=0; i < 192/4; i++){
  211.             glDrawElements(GL_POLYGON, 4, GL_UNSIGNED_INT, vert_ordem[i]);
  212.         }
  213.        
  214.     glPopMatrix();
  215.        
  216.        
  217.     //==================================== PAralelipipedo Amarelo
  218.     /*glColor4f(YELLOW);
  219.     glPushMatrix();
  220.         //?? escala, rotacao, translacao ??
  221.         glutWireTeapot(1);     
  222.     glPopMatrix();
  223.     */
  224. }
  225.  
  226. void teclasNotAscii(int key, int x, int y){
  227.  
  228.         if(key == GLUT_KEY_UP)
  229.             obsP[1] = (obsP[1]+ 0.1) ;
  230.         if(key == GLUT_KEY_DOWN)
  231.             obsP[1] = (obsP[1]- 0.1) ;
  232.        
  233.         if (obsP[1]>yC)
  234.             obsP[1]=yC;
  235.         if (obsP[1]<-yC)
  236.             obsP[1]=-yC;
  237.  
  238.         if(key == GLUT_KEY_LEFT)
  239.             aVisao = (aVisao + 0.1) ;
  240.         if(key == GLUT_KEY_RIGHT)
  241.             aVisao = (aVisao - 0.1) ;
  242.  
  243.         obsP[0]=rVisao*cos(aVisao);
  244.         obsP[2]=rVisao*sin(aVisao);
  245.  
  246.  
  247.     glutPostRedisplay();   
  248.  
  249. }
  250. //codigo novo/////////////////////////////////////////////////////////////////////
  251. // angle of rotation for the camera direction
  252. float angle=0.0;
  253. // actual vector representing the camera's direction
  254. float lx=0.0f,ly=1.0f,lz=-1.0f;
  255. // XZ position of the camera
  256. float x=0.0f, y= 1.0f, z=5.0f;
  257.  
  258.  
  259. float aux=0.0f, auy=0.0f, auz=0.0f;
  260. void display(void){
  261.    
  262.     //================================================================= APaga ecran/profundidade
  263.      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
  264.  
  265. /*
  266.     //ver de cima
  267.     //================================================================= NAO MOFIFICAR
  268.     glViewport (0, 0, 100, 100);                                // ESQUECER PoR AGORA
  269.     glMatrixMode(GL_PROJECTION);                                        // ESQUECER PoR AGORA
  270.     glLoadIdentity();                                                   // ESQUECER PoR AGORA
  271.     glOrtho(-5, 5, -5, 5, -5, 5);
  272.     glMatrixMode(GL_MODELVIEW);                                         // ESQUECER PoR AGORA  
  273.     glLoadIdentity();
  274.    
  275.     gluLookAt(x, 1.0f, z, x+lx,1.0f,z+lz, 0.0f, 0.1f, 0.0f);                                                    // ESQUECER PoR AGORA
  276.     drawEixos();
  277.     drawScene();
  278.     */
  279.    
  280.    
  281.     //ver 3d
  282.     //================================================================= NAO MOFIFICAR
  283.     glViewport (0, 0, wScreen, hScreen);                                // ESQUECER PoR AGORA
  284.     glMatrixMode(GL_PROJECTION);                                        // ESQUECER PoR AGORA
  285.     glLoadIdentity();                                                   // ESQUECER PoR AGORA
  286.     //glOrtho(-30, 30, -30, 30, -30, 30);
  287.     gluPerspective(angZoom, (float)wScreen/hScreen, 0.1, 600*zC);           // ESQUECER PoR AGORA
  288.     glMatrixMode(GL_MODELVIEW);                                         // ESQUECER PoR AGORA  
  289.     glLoadIdentity();                                                   // ESQUECER PoR AGORA
  290.    
  291.    
  292.    
  293.     //-------------------------------------------------------------- observador
  294.     gluLookAt(obsP[0], obsP[1]+50, obsP[2]+200, lx,ly,lz + 100, 0.0f, 0.1f, 0.0f);
  295.  
  296.     //…………………………………………………………………………………………………………………………………………………………Objectos/modelos
  297.     drawEixos();
  298.     drawScene();    
  299.    
  300.     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Actualizacao
  301.     glutSwapBuffers();
  302. }
  303.  
  304. float norma(float x, float y, float z){
  305.     return  sqrt(pow(x,2)+pow(y,2)+pow(z,2));
  306. }
  307.  
  308. void keyboard(unsigned char key, int x1, int x2){
  309.    
  310.     float fraction = 2.0f;
  311.     switch (key) {
  312.     case 'q':
  313.     case 'Q':
  314.         aVisao1=0.0f;
  315.         aVisao1+=0.01f;
  316.         ly = ly + rVisao* sin(aVisao1);
  317.         glutPostRedisplay();
  318.         break;
  319.     case 'e':
  320.     case 'E':
  321.         aVisao1=0.0f;
  322.         aVisao1 -= 0.01f;
  323.         ly = ly + rVisao* sin(aVisao1);
  324.         glutPostRedisplay();
  325.         break;
  326.        
  327.     case 'w':
  328.     case 'W':
  329.         aux = lx - obsP[0];
  330.         auy = ly - obsP[1];
  331.         auz = lz - obsP[2];
  332.        
  333.        
  334.         obsP[0] += (aux / norma(aux, auy, auz)) * fraction;
  335.         obsP[1] += (auy / norma(aux, auy, auz)) * fraction;
  336.         obsP[2] += (auz / norma(aux, auy, auz)) * fraction;
  337.  
  338.         lx += (aux / norma(aux, auy, auz)) * fraction;
  339.         ly += (auy / norma(aux, auy, auz)) * fraction;
  340.         lz += (auz/norma(aux, auy, auz)) * fraction;
  341.        
  342.         glutPostRedisplay();
  343.         break;
  344.  
  345.     case 'A':
  346.     case 'a':
  347.         //angle -= 0.5f;
  348.         aVisao -= 0.1f;
  349.         lx = obsP[0] + rVisao* cos(aVisao);
  350.         lz = obsP[2] + rVisao* sin(aVisao);
  351.  
  352.         glutPostRedisplay();
  353.         break;
  354.  
  355.     case 'S':
  356.     case 's':
  357.         aux = lx - obsP[0];
  358.         auy = ly - obsP[1];
  359.         auz = lz - obsP[2];
  360.        
  361.         obsP[0] -= (aux /norma(aux, auy, auz)) * fraction;
  362.         obsP[1] -= (auy / norma(aux, auy, auz)) * fraction;
  363.         obsP[2] -= (auz/norma(aux, auy, auz)) * fraction;
  364.        
  365.         lx -= (aux / norma(aux, auy, auz)) * fraction;
  366.         ly -= (auy / norma(aux, auy, auz)) * fraction;
  367.         lz -= (auz/norma(aux, auy, auz)) * fraction;
  368.  
  369.         glutPostRedisplay();
  370.         break;
  371.     case 'd':
  372.     case 'D':
  373.         aVisao += 0.1f;
  374.  
  375.         lx = obsP[0] + rVisao* cos(aVisao);
  376.         lz = obsP[2] + rVisao* sin(aVisao);
  377.  
  378.         glutPostRedisplay();
  379.         break; 
  380. //--------------------------- Escape
  381.     case 27:
  382.         exit(0);
  383.         break; 
  384.   }
  385.  
  386. }
  387.  
  388. //======================================================= MAIN
  389. int main(int argc, char** argv){
  390.  
  391.     glutInit(&argc, argv);
  392.     glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH );
  393.     glutInitWindowSize (wScreen, hScreen);
  394.     glutInitWindowPosition (300, 100);
  395.     glutCreateWindow ("|FaceVisivel:'f'|      |Observador:'SETAS'|        |Andar-'a/s'|        |Rodar -'e/d'| ");
  396.  
  397.     inicializa();
  398.    
  399.     glutSpecialFunc(teclasNotAscii);
  400.     glutDisplayFunc(display);
  401.     glutKeyboardFunc(keyboard);
  402.    
  403.     glutMainLoop();
  404.  
  405.     return 0;
  406. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement