接此,
OpenGL视口学习_bcbobo21cn的博客-CSDN博客
把VC6生成的代码中的材质部分注释掉;然后程序运行起来是如下;
把原先GLCube函数的代码替换为如下;下面代码是绘制线框,没有面;它是给出顶点坐标和顶点序号,然后调用glVertex3fv;
void GLCube(GLfloat x1, GLfloat y1, GLfloat z1, GLfloat x2, GLfloat y2, GLfloat z2)
{
int i,j;
//顶点坐标
static const float vertex_list[][3] =
{
-0.5f, -0.5f, -0.5f,
0.5f, -0.5f, -0.5f,
-0.5f, 0.5f, -0.5f,
0.5f, 0.5f, -0.5f,
-0.5f, -0.5f, 0.5f,
0.5f, -0.5f, 0.5f,
-0.5f, 0.5f, 0.5f,
0.5f, 0.5f, 0.5f,
};