openGL 请进

来源:百度知道 编辑:UC知道 时间:2024/06/18 15:11:32
老师给了我们一个openGL程序,运行的结果是一个红色的正方形。大侠们,请帮忙加点语言,叫它转起来!谢谢

first, you find the line with "glBegin" and "glEnd".

in main function
float theta=0;

in display function:
glPushMatrix();
glRotate(theta,0,1,0);
glBegin();
------code given by the teacher
glEnd();
glPopMatrix();

in idle function;
theta+=0.001; // you can modify this to change the speed

then over.

da bu liao zhong wen , bu hao yi si