Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.25 KB | None | 0 0
  1. void display(void){
  2.  
  3.     //================================================================= APaga ecran/profundidade
  4.      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
  5.  
  6.  
  7.     //================================================================= viewport 1
  8.     glViewport (600, 0, 1000, 500);                             // ESQUECER PoR AGORA
  9.   glMatrixMode(GL_PROJECTION);
  10.   glLoadIdentity();
  11.   gluPerspective(angPersp, (float)wScreen/hScreen, 0.1, 100.0);
  12.   glMatrixMode(GL_MODELVIEW);
  13.   glLoadIdentity();
  14.   gluLookAt(obsPini[0], obsPini[1], obsPini[2], obsPfin[0], obsPfin[1], obsPfin[2], 0, 1, 0);
  15.                                                 // ESQUECER PoR AGORA
  16.                         //desenhar objetos
  17.   //drawChao();
  18.   //drawEixos();
  19.   drawScene();
  20.                                             // ESQUECER PoR AGORA
  21.     //================================================================= view port 2
  22.   glViewport(0,0,600,400);
  23.   glMatrixMode(GL_PROJECTION);
  24.     glLoadIdentity();
  25.   glOrtho(-50,50,-50,50,-50,50);
  26.   glMatrixMode(GL_MODELVIEW);
  27.   glLoadIdentity();
  28.   gluLookAt(-15,20,0,-15,0,0,0,0,-1);
  29.                                     // ESQUECER PoR AGORA
  30.  
  31.  
  32.   //drawEixos();
  33.     drawScene();
  34.  
  35.   //================================================================= viewport 3
  36.   glViewport (0, 500, 800, 500);                                // ESQUECER PoR AGORA
  37.   glMatrixMode(GL_PROJECTION);
  38.   glLoadIdentity();
  39.   gluPerspective(angPersp, (float)wScreen/hScreen, 0.1, 100.0);
  40.   glMatrixMode(GL_MODELVIEW);
  41.   glLoadIdentity();
  42.   gluLookAt(-30+obsPini[0], obsPini[1],10+obsPini[2], -15+obsPfin[0], 0+obsPfin[1], 0+obsPfin[2], 0, 1, 0);
  43.                         // ESQUECER PoR AGORA
  44.                         //desenhar objetos
  45.  
  46.   //drawEixos();
  47.   drawScene();
  48.   //================================================================= viewport 4
  49.   glViewport (800, 500, 800, 500);                              // ESQUECER PoR AGORA
  50.   glMatrixMode(GL_PROJECTION);
  51.   glLoadIdentity();
  52.   gluPerspective(angPersp, (float)wScreen/hScreen, 0.1, 100.0);
  53.   glMatrixMode(GL_MODELVIEW);
  54.   glLoadIdentity();
  55.   gluLookAt(5+obsPini[0], obsPini[1],10+obsPini[2], -15+obsPfin[0], 0+obsPfin[1], 0+obsPfin[2], 0, 1, 0);
  56.                         // ESQUECER PoR AGORA
  57.                         //desenhar objetos
  58.  
  59.   //drawEixos();
  60.   drawScene();
  61.  
  62.     //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Actualizacao
  63.     glutSwapBuffers();
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement