網址:jsyeh.org/3dcg10

下載
data
win32
glut32.dll
打開 win32
shapes.exe

課堂作業二
#include <GL/glut.h>
void display()
{
glColor3f(1,0,0);
glutSolidTeapot(0.3);
glutSwapBuffers();
}
int main(int argc,char**argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
glutCreateWindow("Hello 3D");
glutDisplayFunc(display);
glutMainLoop();
}

課堂作業三
#include <GL/glut.h>
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1,0,0);
glClearColor(0,1,0,0);
glutSolidTeapot(0.3);
glutSwapBuffers();
}
int main(int argc,char**argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
glutCreateWindow("Hello 3D");
glutDisplayFunc(display);
glutMainLoop();
}

沒有留言:
張貼留言