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/12/20 05:14:45
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才能看到