SHARE
TWEET

Untitled

a guest Dec 12th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void dimfront()
  2. {
  3.     if (k5 == 0)
  4.     {
  5.         glMatrixMode(GL_PROJECTION);
  6.         glLoadIdentity();
  7.         degree = 0;
  8.         glOrtho(-150, 150, -150, 150, -200, 150);
  9.         glRotatef(15, 1, 0, 0);
  10.         glRotatef(degree, 0, -1, 0);
  11.         k5++;
  12.     }
  13.    
  14.     //alpha = 0;
  15.  
  16.     if (degree == 104)
  17.     {
  18.         glRotatef(104, 0, 1, 0);
  19.  
  20.         degree = 0;
  21.     }
  22.     else if (degree == 359)
  23.     {
  24.         glRotatef(104, 0, -1, 0);
  25.         degree = 103;
  26.     }
  27.     glRotatef(alpha, 0, -1, 0);
  28.     glRotatef(degree, 0, 1, 0);
  29.  
  30.     glColor3f(0.8, 0.8, 0.8);
  31.     glBegin(GL_LINES);
  32.     glVertex3f(0, -50, 0);
  33.     glVertex3f(-100, -50, 35);
  34.     glVertex3f(0, -50, 0);
  35.     glVertex3f(17, -50, 100);
  36.  
  37.     glVertex3f(0, -50, 0);
  38.     glVertex3f(0, 100, 0);
  39.     glFlush();
  40.     glEnd();
  41.     glRotatef(degree, 0, -1, 0);
  42.     //glBegin(GL_LINE_STRIP);
  43.     glBegin(GL_LINES);
  44.  
  45.     glColor3f(0.5, 0.5, 0.5);
  46.  
  47.     glVertex3f(-50 - 25 + 25 * sin(degree*3.1415926 / 180), -50, -50 + 38 * sin(degree*3.1415926 / 180));
  48.     glVertex3f(50 - 25 + 12 * sin(degree*3.1415926 / 180), -50, -50 - 8 * sin(degree*3.1415926 / 180));
  49.  
  50.     if (degree >= 14)
  51.     {
  52.  
  53.         glColor3f(1.0, 0.0, 0.0);
  54.  
  55.     }
  56.     else
  57.         glColor3f(0.5, 0.5, 0.5);
  58.  
  59.     glVertex3f(50 - 25 + 12 * sin(degree*3.1415926 / 180), -50, -50 - 8 * sin(degree*3.1415926 / 180));
  60.     glVertex3f(50 - 25 + 12 * sin(degree*3.1415926 / 180), 50, -50 - 8 * sin(degree*3.1415926 / 180));
  61.  
  62.     glColor3f(1.0, 0.0, 0.0);
  63.  
  64.  
  65.    
  66.     glVertex3f(-50 - 25 + 25 * sin(degree*3.1415926 / 180), 50, -50 + 38 * sin(degree*3.1415926 / 180));
  67.     glVertex3f(50 - 25 + 12 * sin(degree*3.1415926 / 180), 50, -50 - 8 * sin(degree*3.1415926 / 180));
  68.  
  69.     if (degree >= 14)
  70.     {
  71.         glColor3f(0.5, 0.5, 0.5);
  72.  
  73.  
  74.     }
  75.     else
  76.         glColor3f(1.0, 0.0, 0.0);
  77.  
  78.     glVertex3f(-50 - 25 + 25 * sin(degree*3.1415926 / 180), -50, -50 + 38 * sin(degree*3.1415926 / 180));
  79.     glVertex3f(-50 - 25 + 25 * sin(degree*3.1415926 / 180), 50, -50 + 38 * sin(degree*3.1415926 / 180));
  80.     glEnd();
  81.  
  82.  
  83.  
  84.  
  85.     //glBegin(GL_LINE_STRIP);
  86.     glBegin(GL_LINES);
  87.    
  88.         glColor3f(1.0, 0.0, 0.0);
  89.    
  90.     glVertex3f(-50 + 19 * sin(degree*3.1415926 / 180), -50, 50 + 34 * sin(degree*3.1415926 / 180));
  91.     glVertex3f(50 + 10 * sin(degree*3.1415926 / 180), -50, 50 - 15 * sin(degree*3.1415926 / 180));
  92.  
  93.  
  94.         glColor3f(1.0, 0.0, 0.0);
  95.    
  96.     glVertex3f(50 + 10 * sin(degree*3.1415926 / 180), -50, 50 - 15 * sin(degree*3.1415926 / 180));
  97.     glVertex3f(50 + 10 * sin(degree*3.1415926 / 180), 50, 50 - 15 * sin(degree*3.1415926 / 180));
  98.  
  99.  
  100.  
  101.     glColor3f(1.0, 0.0, 0.0);
  102.     /*else
  103.     glColor3f(0.5, 0.5, 0.5);*/
  104.     glVertex3f(-50 + 19 * sin(degree*3.1415926 / 180), 50, 50 + 34 * sin(degree*3.1415926 / 180));
  105.     glVertex3f(50 + 10 * sin(degree*3.1415926 / 180), 50, 50 - 15 * sin(degree*3.1415926 / 180));
  106.  
  107.      glColor3f(1.0, 0.0, 0.0);
  108.     glVertex3f(-50 + 19 * sin(degree*3.1415926 / 180), -50, 50 + 34 * sin(degree*3.1415926 / 180));
  109.     glVertex3f(-50 + 19 * sin(degree*3.1415926 / 180), 50, 50 + 34 * sin(degree*3.1415926 / 180));
  110.     glEnd();
  111.  
  112.  
  113.  
  114.  
  115.  
  116.     glBegin(GL_LINES);
  117.     if (degree >= 14)
  118.     {
  119.         glColor3f(0.5, 0.5, 0.5);
  120.  
  121.     }
  122.     else
  123.         glColor3f(1.0, 0.0, 0.0);
  124.  
  125.     glVertex3f(-50 + 19 * sin(degree*3.1415926 / 180), -50, 50 + 34 * sin(degree*3.1415926 / 180));
  126.     glVertex3f(-50 - 25 + 25 * sin(degree*3.1415926 / 180), -50, -50 + 38 * sin(degree*3.1415926 / 180));
  127.  
  128.  
  129.     if (degree >= 14)
  130.     {
  131.         glColor3f(1.0, 0.0, 0.0);
  132.        
  133.     }
  134.     else
  135.         glColor3f(0.5, 0.5, 0.5);
  136.  
  137.    
  138.     glVertex3f(50 - 25 + 12 * sin(degree*3.1415926 / 180), -50, -50 - 8 * sin(degree*3.1415926 / 180));
  139.     glVertex3f(50 + 10 * sin(degree*3.1415926 / 180), -50, 50 - 15 * sin(degree*3.1415926 / 180));
  140.  
  141.     glColor3f(1.0, 0.0, 0.0);
  142.  
  143.     glVertex3f(50 - 25 + 12 * sin(degree*3.1415926 / 180), 50, -50 - 8 * sin(degree*3.1415926 / 180));
  144.     glVertex3f(50 + 10 * sin(degree*3.1415926 / 180), 50, 50 - 15 * sin(degree*3.1415926 / 180));
  145.  
  146.     glColor3f(1.0, 0.0, 0.0);
  147.  
  148.     glVertex3f(-50 + 19 * sin(degree*3.1415926 / 180), 50, 50 + 34 * sin(degree*3.1415926 / 180));
  149.     glVertex3f(-50 - 25 + 25 * sin(degree*3.1415926 / 180), 50, -50 + 38 * sin(degree*3.1415926 / 180));
  150.     glEnd();
  151.  
  152.  
  153.     glFlush();
  154. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top