2016年3月7日 星期一

Week3_許皓翔 - 河蟹牌Part 2

作業一 :

1.輸入網址,並下載 "data"、"win32" 及 "glut32.dll"
http://www.cmlab.csie.ntu.edu.tw/~jsyeh/3dcg10/



2.解壓縮 "data" 跟 "window" ,打開data-data 把裡面的檔案拉到第一層data,把多的data刪掉。
   window裡的檔案也拉出來。


3.執行 "Transformation"



作業二 :

1.開啟Code::Blocks - 建專案
   file - New - Project - GLUT - 檔名&設目的地(桌面) - location 到 freeglut-MinGW-2.8.1-1.mp - freeglut - lib (記得要先把 libfreeglut.a 改名為 freeglut32.a)

2.程式碼



#include <GL/glut.h>
void display()
{
    glBegin(GL_POLYGON);
        glColor3f(1,1,0);

        glVertex2f(0.5,0.5);
        glVertex2f(0.5,-0.5);
        glVertex2f(0,0);
    glEnd();
    glutSwapBuffers();
}
int main(int argc,char**argv)
{
    glutInit(&argc , argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
    glutCreateWindow("03161060");

    glutDisplayFunc(display);
    glutMainLoop();
}


// glColor3f  可以改顏色 。 ex : glColor3f(1,1,0);
// glVertex2f 改變點的位置 。 ex : glVertex2f(0.5,0.5);

作業三 :

改編程式

回家作業 :

一 : 執行jsyeh.org/3dcg10 裡的範例


二 :請做出有點線面色彩的程式 
ex : 三角形~~~
 

三 : 將作業增到 20個頂點、5種色彩 
阿愣(戴帽子版 - 自繪)


四 : 自我發揮, 利用老師教的小畫家或其他工具幫忙, 讓你的程式可以做得很炫 
做到快ㄅㄧㄥˋ軌..
Mario !!!!!!!!!!!!!!!!!!!!!
1.把找到的圖片弄到小畫家
2.將圖片像素調200(水平),找點座標
3.用吸管取得圖片的顏色,並以程式碼中輸入顏色的值
4.將座標輸入
5.執行,完成








沒有留言:

張貼留言