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/11/15 09:03:47
opengl怎么画球?#include"windows.h"#defineGLUT_DISABLE_ATEXIT_HACK#include#includevoiddisplay(){glClear(G

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才能看到