当不进行旋转和平移时,画三个轴,Z轴能被隐藏。
但当经过旋转和平移后,Z轴能被隐藏时,Y轴为什么是倾斜的。有没办法Y轴不倾斜?
glTranslatef(0, 0, -2.0f);
glRotatef(m_rorate[0], 1, 0, 0);//旋转 绕X轴
glRotatef(m_rorate[1], 0, 1, 0);//旋转 绕Y轴
glColor3f(1.0f, 0.0f, 0.0f);
//glTranslatef(-0.5f, -0.5f, -0.5f);
glBegin(GL_LINES);
glVertex3f(0.0f, 0.0f, 0.0f);
glVertex3f(1.0f, 0.0f, 0.0f);
glEnd();
glBegin(GL_LINES);
glVertex3f(0.0f, 0.0f, 0.0f);
glVertex3f(0.0f, 1.0f, 0.0f);
glEnd();
glBegin(GL_LINES);
glVertex3f(0.0f, 0.0f, 0.0f);
glVertex3f(0.0f, 0.0f, 1.0f);
glEnd();