opengl怎么画球?#include "windows.h"#define GLUT_DISABLE_ATEXIT_HACK#include #include void display(){glClear(GL_COLOR_BUFFER_BIT);glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glColor3f( 1.0f,1.0f,1.0f );glutSolidSphere( 50.f,15,15 ); glutSwapBuff

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/17 00:00:50

opengl怎么画球?#include "windows.h"#define GLUT_DISABLE_ATEXIT_HACK#include #include void display(){glClear(GL_COLOR_BUFFER_BIT);glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glColor3f( 1.0f,1.0f,1.0f );glutSolidSphere( 50.f,15,15 ); glutSwapBuff
opengl怎么画球?
#include "windows.h"
#define GLUT_DISABLE_ATEXIT_HACK
#include
#include
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;
}
高手给看看什么地方不对了,怎么改,屏幕上是空白的

opengl怎么画球?#include "windows.h"#define GLUT_DISABLE_ATEXIT_HACK#include #include void display(){glClear(GL_COLOR_BUFFER_BIT);glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glColor3f( 1.0f,1.0f,1.0f );glutSolidSphere( 50.f,15,15 ); glutSwapBuff
你的glutSolidSphere中的第一个参数太大,要小于1才能看到