Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void proec()
- {
- if (k1 == 0) {
- glClearColor(0, 0, 0, 1.0);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-150, 150, -150+60, 150+60, -150, 150);
- //k1++;
- }
- glClear(GL_COLOR_BUFFER_BIT);
- glPushMatrix();
- //glPushMatrix();
- //glRot
- //glRotated(5, 1, 0, 0);
- glRotated(degree, 0, 1, 0);
- //glRotated(alpha, 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 + 150, -50 );
- glVertex3f(50, -50 + 150, -50);
- if (degree > 0 && degree <90)
- {
- /*if (degree == 180)
- glColor3f(1.0, 0.0, 0.0);
- else*/
- glColor3f(0.5, 0.5, 0.5);
- }
- else
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(50, -50 + 150, -50);
- glVertex3f(50, 50 + 150, -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 + 150, -50);
- glVertex3f(-50, 50 + 150, -50);
- if (degree > 270 && degree < 360)
- {
- glColor3f(0.5, 0.5, 0.5);
- }
- else
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(-50, 50 + 150, -50);
- glVertex3f(-50, -50 + 150, -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 + 150, 50);
- glVertex3f(50, -50 + 150, 50);
- if (degree >90 && degree < 180)
- {
- glColor3f(0.5, 0.5, 0.5);
- }
- else
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(50, -50 + 150, 50);
- glVertex3f(50, 50 + 150, 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 + 150, 50);
- glVertex3f(-50, 50 + 150, 50);
- if (degree > 180 && degree < 270)
- {
- glColor3f(0.5, 0.5, 0.5);
- }
- else glColor3f(1.0, 0.0, 0.0);
- glVertex3f(-50, 50 + 150, 50);
- glVertex3f(-50, -50 + 150, 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 + 150, 50);
- glVertex3f(-50, -50 + 150, -50);
- /*if (degree >= 0 && degree <= 180)
- {*/
- glColor3f(1.0, 0.0, 0.0);
- /*}
- else glColor3f(0.5, 0.5, 0.5);*/
- glVertex3f(50, -50 + 150, 50);
- glVertex3f(50, -50 + 150, -50);
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(50, 50 + 150, 50);
- glVertex3f(50, 50 + 150, -50);
- glColor3f(1.0, 0.0, 0.0);
- glVertex3f(-50, 50 + 150, 50);
- glVertex3f(-50, 50 + 150, -50);
- glEnd();
- //glFlush();
- //glPopMatrix();
- //////////////////////////////////////////////////////////////////////////////////////////////////
- //glClear(GL_COLOR_BUFFER_BIT);
- // glPushMatrix();
- /*if (k2 == 0)
- {
- glRotated(degree, 0, -1, 0);
- glRotated(55, 1, 0, 0);
- glRotated(degree, 0, 1, 0);
- k2++;
- }*/
- glRotated(degree, 0, -1, 0);
- // glRotated(alpha, 0, 1, 0);
- glRotated(90, 1, 0, 0);
- glRotated(degree, 0, 1, 0);
- //glRotated(alpha, 0, -1, 0);
- /*glRotated(alpha, 0, 1, 0);
- glRotated(55, 1, 0, 0);*/
- //glRotated(alpha, 0, -1, 0);
- glRotated(beta, -1, 0, 0);
- glRotated(gamma, 0, 0, 1);
- 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();
- //glPopMatrix();
- // glRotated(55, -1, 0, 0);
- glPopMatrix();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement