HW 1
網址:jsyeh.org/3dcg10
HW 2
程式碼:
#include <GL/glut.h> //標頭檔
void display()
{
glColor3f(0,0,1); //改變顏色,3 指有3個數字,f 是符點數
glutSolidTeapot(0.3);
glutSwapBuffers();
}
int main(int argc,char**argv)
{
glutInit(&argc,argv); //引入程式
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH); //雙視窗
glutCreateWindow("hello 3D"); //視窗名稱
glutDisplayFunc(display); //展示
glutMainLoop();
}
HW 3
程式碼:
#include <GL/glut.h>
void display()
{
glClearColor(1,1,0,0); //改背景顏色
glClear(GL_COLOR_BUFFER_BIT); //青背景
glColor3f(0,0,1);//改變顏色,3 指有3個數字,f 是符點數
glutSolidTeapot(0.3);
glutSwapBuffers();
}
int main(int argc,char**argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("hello 3D");
glutDisplayFunc(display);
glutMainLoop();
}



沒有留言:
張貼留言