glut 常用函数描述
虽然现在OpenGL工具已经非常多了,但是使用GLUT会非常方便,有些glut常用函数列在这里:
设置初始窗口的位置(窗口左上角相对于桌面坐标(x,y))
void glutInitWindowPosition(int x, int y);
把当前的矩阵变换入栈
glPushMatrix();
把当前的矩阵变换出栈
glPopMatrix();
在x轴方向平移-1.0单位长度
glTranslatef(-1.0, 0.0f, 0.0f);
沿着x轴旋转x_rotate
glRotatef(x_rotate, 1.0, 0.0, 0.0);
沿着y轴旋转y_rotate
glRotatef(y_rotate, 0.0, 1.0, 0.0);
缩放0.2倍
glScalef(0.2, 0.2, 0.2);