根据上一篇文章关于OpenGL环境配置,配置完成后。https://blog.youkuaiyun.com/liyunlong19870123/article/details/113849711
直接方代码(test.c)
#include <GL/glut.h>
#define ColoredVertex(c, v) do{ glColor3fv(c); glVertex3fv(v); }while(0)
static int angle = 0;
static int rotateMode = 0;
void myDisplay(void)
{
static int list = 0;
if (list == 0)
{
GLfloat
PointA[] = { 0.5f, 0.5f, -0.5f },
PointB[] = { 0.5f, -0.5f, -0.5f },
PointC[] = { -0.5f, -0.5f, -0.5f },
PointD[] = { -0.5f, 0.5f, -0.5f },
PointE[] = { 0.5f, 0.5f, 0.5f },
PointF[] = { 0.5f, -0.5f, 0.5f },
PointG[] = { -0.5f, -0.5f, 0.5f },
PointH[] = {