2019年3月7日 星期四

06160123_Week03電腦圖學

🔺電腦圖學2019-03-07 Week03(上週228)

(1)點、線、面、顏色
(2)實作:第一週 親手寫出
(3)漏題:期中考題
(4)回家作業:

TODO:點名:Veyon Config > 服務 >啟動服務
TODO:到http://www.cmlab.csie.ntu.edu.tw/~jsyeh/3dcg10/
download:window.zip  解壓縮 至window
                    data.zip    解壓縮 data拉至window
                    glut32.dll  解壓縮 glut32.dll移至window資料夾

開啟 下載\window\shape.exe 


 
滑鼠移到左側 > 右鍵 > Toggle big vertices


















滑鼠移到右側 > 右鍵 >Polygon















#茶壺

1、Download Freeglut package

2、將檔案解壓縮後複製一個libfreeglut.a檔並重新命名為libglut32.a

3、開啟Code Blocks>新增一個新的專案>點選Glut project

4、命名專案>選擇資料存放區(C:\Users\user\Downloads\freeglut\lib)>Finish

5、於左側project開啟程式碼>執行

6、刪掉全部程式碼,重新編輯:


#include <GL/glut.h>

void display(){



    glutSolidTeapot( 0.3 );

    glutSwapBuffers();

}

int main(int argc,char**argv){

    glutInit(&argc,argv);

    glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);

    glutCreateWindow("06160123");
    glutDisplayFunc(display);
    glutMainLoop();
}













7、改變顏色
加入程式碼glColor3f(0.40,0.10,0.30);

重新編輯:


#include <GL/glut.h>
void display(){

    glutSolidTeapot( 0.3 );
    glutSwapBuffers();
}
int main(int argc,char**argv){
    glutInit(&argc,argv);
    glutInitDisplayMode(GLUT_DOUBLE|GLUT_DEPTH);
    glutCreateWindow("06160123");
    glColor3f(0.40,0.10,0.30);
    glutDisplayFunc(display);
    glutMainLoop();
}


沒有留言:

張貼留言