opengl怎么画球?
#include"windows.h"#defineGLUT_DISABLE_ATEXIT_HACK#include<gl/glut.h>#include<gl/glu....
#include "windows.h"
#define GLUT_DISABLE_ATEXIT_HACK
#include <gl/glut.h>
#include <gl/glu.h>
void display(){
glClear(GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glColor3f( 1.0f, 1.0f, 1.0f );
glutSolidSphere( 50.f, 15, 15 );
glutSwapBuffers();
}
int main(int argc, char* argv[]){
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutCreateWindow("小球");
glClearColor(0.0f, 1.0f, 1.0f, 1.0f);
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
高手给看看什么地方不对了,怎么改,屏幕上是空白的 展开
#define GLUT_DISABLE_ATEXIT_HACK
#include <gl/glut.h>
#include <gl/glu.h>
void display(){
glClear(GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glColor3f( 1.0f, 1.0f, 1.0f );
glutSolidSphere( 50.f, 15, 15 );
glutSwapBuffers();
}
int main(int argc, char* argv[]){
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutCreateWindow("小球");
glClearColor(0.0f, 1.0f, 1.0f, 1.0f);
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
高手给看看什么地方不对了,怎么改,屏幕上是空白的 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询