2024年2月22日 星期四

從0到0.01的電腦圖學 Week01

1. 加入Blogger

2. 設定個人品牌

3. 需要加標籤 學號_姓名 , WeekXX

4. 各種截圖方法


5. 建立OpenGL專案

a. File -> New -> Project

b.
c.
d.
6. 建立GLUT專案
a. 下載FreeGLUT MinGW 版,放到桌面
b. 複製libfreeglut.a並貼上後(同一個位置) 重新命名為libglut32.a
c.
File -> New -> Project

d.
e.
f. 將剛才下載的函式庫目錄根貼在此處
g.


7. 第一個程式碼 :顯示茶壺
    
#include <GL/glut.h>   //使用GLUT函式庫

void display(){
    glColor3f(0.71,1,1);
    glutSolidTeapot(0.5);
    glutSwapBuffers();
}

int main(int argc, char *argv[]){ //main()函式
    glutInit(&argc, argv); //開啟GLUT功能
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
    glutCreateWindow("電腦圖學第01周"); //開一個GLUT視窗
    glutDisplayFunc(display); //display()函式畫圖
    glutMainLoop(); //主要的迴圈 不結束程式
}



People needing to be saved
Scream out for help every day
But we grow numb to the sounds
And feelings slowly start to drown

When sound all ceases to exist
People think that means happiness
And all the sounds that used to be
Are all just noise to you and me

----SOS , SEKAI NO OWARI

沒有留言:

張貼留言