Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void dimfront()
- {
- if (k5 == 0)
- {
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- degree = 0;
- glOrtho(-150, 150, -150, 150, -200, 150);
- glRotatef(15, 1, 0, 0);
- glRotatef(degree, 0, -1, 0);
- k5++;
- }
- //alpha = 0;
- if (degree == 104)
- {
- glRotatef(104, 0, 1, 0);
- degree = 0;
- }
- else if (degree == 359)
- {
- glRotatef(104, 0, -1, 0);
- degree = 103;
- }
- glRotatef(alpha, 0, -1, 0);
- glRotatef(degree, 0, 1, 0);
- glColor3f(0.8, 0.8, 0.8);
- glBegin(GL_LINES);
- glVertex3f(0, -50, 0);
- glVertex3f(-100, -50, 35);
- glVertex3f(0, -50, 0);
- glVertex3f(17, -50, 100);
- glVertex3f(0, -50, 0);
- glVertex3f(0, 100, 0);
- glFlush();
- glEnd();
- glRotatef(degree, 0, -1, 0);
- //glBegin(GL_LINE_STRIP);
- glBegin(GL_LINES);
- glColor3f(0.5, 0.5, 0.5);
- glVertex3f(-50 - 25 + 25 * sin(degree*3.1415926 / 180), -50, -50 + 38 * sin(degree*3.1415926 / 180));
- glVertex3f(50 - 25 + 12 * sin(degree*3.1415926 / 180), -50, -50 - 8 * sin(degree*3.1415926 / 180));
- if (degree >= 14)
- {
- glColor3f(1.0, 0.0, 0.0);
- }
- else
- glColor3f(0.5, 0.5, 0.5);
- glVertex3f(50 - 25 + 12 * sin(degree*3.1415926 / 180), -50, -50 - 8 * sin(degree*3.1415926 / 180));
- glVertex3f(50 - 25 + 12 * sin(degree*3.1415926 / 180), 50, -50 - 8 * sin(degree*3.1415926 / 180));
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(-50 - 25 + 25 * sin(degree*3.1415926 / 180), 50, -50 + 38 * sin(degree*3.1415926 / 180));
- glVertex3f(50 - 25 + 12 * sin(degree*3.1415926 / 180), 50, -50 - 8 * sin(degree*3.1415926 / 180));
- if (degree >= 14)
- {
- glColor3f(0.5, 0.5, 0.5);
- }
- else
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(-50 - 25 + 25 * sin(degree*3.1415926 / 180), -50, -50 + 38 * sin(degree*3.1415926 / 180));
- glVertex3f(-50 - 25 + 25 * sin(degree*3.1415926 / 180), 50, -50 + 38 * sin(degree*3.1415926 / 180));
- glEnd();
- //glBegin(GL_LINE_STRIP);
- glBegin(GL_LINES);
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(-50 + 19 * sin(degree*3.1415926 / 180), -50, 50 + 34 * sin(degree*3.1415926 / 180));
- glVertex3f(50 + 10 * sin(degree*3.1415926 / 180), -50, 50 - 15 * sin(degree*3.1415926 / 180));
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(50 + 10 * sin(degree*3.1415926 / 180), -50, 50 - 15 * sin(degree*3.1415926 / 180));
- glVertex3f(50 + 10 * sin(degree*3.1415926 / 180), 50, 50 - 15 * sin(degree*3.1415926 / 180));
- glColor3f(1.0, 0.0, 0.0);
- /*else
- glColor3f(0.5, 0.5, 0.5);*/
- glVertex3f(-50 + 19 * sin(degree*3.1415926 / 180), 50, 50 + 34 * sin(degree*3.1415926 / 180));
- glVertex3f(50 + 10 * sin(degree*3.1415926 / 180), 50, 50 - 15 * sin(degree*3.1415926 / 180));
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(-50 + 19 * sin(degree*3.1415926 / 180), -50, 50 + 34 * sin(degree*3.1415926 / 180));
- glVertex3f(-50 + 19 * sin(degree*3.1415926 / 180), 50, 50 + 34 * sin(degree*3.1415926 / 180));
- glEnd();
- glBegin(GL_LINES);
- if (degree >= 14)
- {
- glColor3f(0.5, 0.5, 0.5);
- }
- else
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(-50 + 19 * sin(degree*3.1415926 / 180), -50, 50 + 34 * sin(degree*3.1415926 / 180));
- glVertex3f(-50 - 25 + 25 * sin(degree*3.1415926 / 180), -50, -50 + 38 * sin(degree*3.1415926 / 180));
- if (degree >= 14)
- {
- glColor3f(1.0, 0.0, 0.0);
- }
- else
- glColor3f(0.5, 0.5, 0.5);
- glVertex3f(50 - 25 + 12 * sin(degree*3.1415926 / 180), -50, -50 - 8 * sin(degree*3.1415926 / 180));
- glVertex3f(50 + 10 * sin(degree*3.1415926 / 180), -50, 50 - 15 * sin(degree*3.1415926 / 180));
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(50 - 25 + 12 * sin(degree*3.1415926 / 180), 50, -50 - 8 * sin(degree*3.1415926 / 180));
- glVertex3f(50 + 10 * sin(degree*3.1415926 / 180), 50, 50 - 15 * sin(degree*3.1415926 / 180));
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(-50 + 19 * sin(degree*3.1415926 / 180), 50, 50 + 34 * sin(degree*3.1415926 / 180));
- glVertex3f(-50 - 25 + 25 * sin(degree*3.1415926 / 180), 50, -50 + 38 * sin(degree*3.1415926 / 180));
- glEnd();
- glFlush();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement