(一)
(二)
1.將茶壺加顏色
2.層層疊起顏色
(三)
改背景顏色
(四)
利用點線面做出三角形
附上程式碼
#include <GL/glut.h> ///include 外掛GLUT的工具
void display()
{
glClearColor(1,0.5,1,1);
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glColor3f(1,1,0);
glVertex2f(0,0);
glVertex2f(1,0);
glVertex2f(0,1);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1,0,0);
glVertex2f(0,0);
glColor3f(0,1,0);
glVertex2f(-1,0);
glColor3f(0,0,1);
glVertex2f(0,-1);
glColor3f(0,1,1);
glVertex2f(0,-1);
glEnd();
glFlush();
}
int main (int argc, char**argv)
{
glutInit(&argc, argv);
glutCreateWindow("02160925 葉乃慈");
glutDisplayFunc(display);
glutMainLoop();
}
沒有留言:
張貼留言