1.先到 jsyeh.org/3dcg10下載[data][win32][glut32.dll]
2.減壓縮window再把data的資料夾以及[glut32.dll]丟進去window的資料夾
3.點選window裡面的[shape](右鍵可更改內容)
課堂作業2
#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();
}
課堂作業3
#include <GL/glut.h>
void display()
{
glClear(GL_COLOR_BUFFER_BIT);清背景
glClearColor(0,1,0,0);更改背景顏色
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();
}
沒有留言:
張貼留言