程序运行效果:
代码如下:
#include<gl/glut.h>
#include<math.h>
#include<windows.h>
#include<algorithm>
using namespace std;
const GLubyte index[] = { 0, 3, 2, 1, 2, 3, 7, 6, 0, 4, 7, 3, 0, 1, 5, 4, 1, 2, 6, 5, 4, 5, 6, 7 };
const float vertex[] = { -1.0, -1.0, -1.0, 1.0, -1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0,-1.0, -