我为绘制 X 轴编写了这段代码:
glPushMatrix();
glColor3f(0.5f, 0, 0);
glVertex3f(-size, 0, 0);
glVertex3f( size, 0, 0);
glPopMatrix();
但是当我添加这部分代码来绘制箭头时;所有其他形状(例如 shperes)都被隐藏:
glBegin(GL_TRIANGLES); // Drawing Using Triangles
glVertex3f( 10.0f, 0.0f, 0.0f); // Top
glVertex3f(9.0f, 0.25f, 0.0f); // Bottom Left
glVertex3f(9.0f,-0.25f, 0.0f); // Bottom Right
glEnd();
我怎么了?