Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void izompryam()
- {
- if (k == 0)
- {
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-150, 150, -150, 150, -200, 150);
- glRotatef(30, 1, 0, 0);
- glRotatef(degree, 0, -1, 0);
- k++;
- }
- 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, 100);
- glVertex3f(0, -50, 0);
- glVertex3f(100, -50, 100);
- glVertex3f(0, -50, 0);
- glVertex3f(0, 100, 0);
- glEnd();
- glRotatef(degree, 0, -1, 0);
- //alpha = 0;
- //glBegin(GL_LINE_STRIP);
- glBegin(GL_LINES);
- if (degree >= 0 && degree < 90 || degree > 270 && degree < 360)
- {
- glColor3f(0.5, 0.5, 0.5);
- }
- else if (degree >= 90 && degree <= 270)
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(-50, -50, -50);
- glVertex3f(50, -50, -50);
- if (degree >= 0 && degree <= 270)
- {
- /*if (degree == 180)
- glColor3f(1.0, 0.0, 0.0);
- else*/
- glColor3f(1.0, 0.0, 0.0);
- }
- else if (degree > 270 && degree < 360)
- glColor3f(0.5, 0.5, 0.5);
- glVertex3f(50, -50, -50);
- glVertex3f(50, 50, -50);
- /*if (degree > 0 && degree < 90 || degree > 270 && degree < 360)
- {
- if (degree == 180)
- glColor3f(1.0, 0.0, 0.0);
- else
- glColor3f(0.5, 0.5, 0.5);
- }
- else if (degree >= 90 && degree <= 270)*/
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(50, 50, -50);
- glVertex3f(-50, 50, -50);
- if (degree > 0 && degree < 90)
- {
- glColor3f(0.5, 0.5, 0.5);
- }
- else
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(-50, 50, -50);
- glVertex3f(-50, -50, -50);
- glEnd();
- //glBegin(GL_LINE_STRIP);
- glBegin(GL_LINES);
- if (degree >= 270 && degree < 360 || degree >= 0 && degree <= 90)
- {
- glColor3f(1.0, 0.0, 0.0);
- }
- else
- glColor3f(0.5, 0.5, 0.5);
- glVertex3f(-50, -50, 50);
- glVertex3f(50, -50, 50);
- if (degree >= 270 && degree < 360 || degree >= 0 && degree <= 180)
- {
- glColor3f(1.0, 0.0, 0.0);
- }
- else
- glColor3f(0.5, 0.5, 0.5);
- glVertex3f(50, -50, 50);
- glVertex3f(50, 50, 50);
- /*if (degree >=0 && degree <= 90 || degree >= 270 && degree <= 360)
- {
- glColor3f(1.0, 0.0, 0.0);
- }
- else if (degree > 90 && degree < 270)
- if (degree == 180)*/
- glColor3f(1.0, 0.0, 0.0);
- /*else
- glColor3f(0.5, 0.5, 0.5);*/
- glVertex3f(50, 50, 50);
- glVertex3f(-50, 50, 50);
- if (degree > 90 && degree < 180)
- {
- glColor3f(0.5, 0.5, 0.5);
- }
- else glColor3f(1.0, 0.0, 0.0);
- glVertex3f(-50, 50, 50);
- glVertex3f(-50, -50, 50);
- glEnd();
- //glBegin(GL_LINE_STRIP);
- ////glBegin(GL_LINES);
- //glColor3f(1.0, 0.0, 0.0);
- glBegin(GL_LINES);
- if (degree > 0 && degree < 180)
- {
- glColor3f(0.5, 0.5, 0.5);
- }
- else
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(-50, -50, 50);
- glVertex3f(-50, -50, -50);
- if (degree >= 0 && degree <= 180)
- {
- glColor3f(1.0, 0.0, 0.0);
- }
- else glColor3f(0.5, 0.5, 0.5);
- glVertex3f(50, -50, 50);
- glVertex3f(50, -50, -50);
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(50, 50, 50);
- glVertex3f(50, 50, -50);
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(-50, 50, 50);
- glVertex3f(-50, 50, -50);
- glEnd();
- glFlush();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement