精选优质文档-倾情为你奉上实验一1. (1)三角形:#include / glut.h includes gl.h and glu.hvoid init(void) glClearColor(0.0, 0.0, 0.0, 0.0);void reshape(int w, int h) glViewport(0, 0, (GLsizei)w, (GLsizei)h);glMatrixMode(GL_PROJECTION);/ 指定哪一个矩阵是当前矩阵glLoadIdentity();/重置当前指定的矩阵为单位矩阵。gluOrtho2D(-1.0, 1.0, -1.0, 1.0); / The para are: (left, right, bottom, top) 定义二维正交投影矩阵glMatrixMode(GL_MODELVIEW); /指定哪一个矩阵是当前矩阵void display(void) glClear(GL_COLOR_BUFFER_BIT); /