2024年5月2日 星期四

C~電腦圖學日誌 Week11

 Week11


week11-0_sample

1.安裝freeglut,複製libfreeglut.a改成libglut32.a

2.新增GLUT專案取名成week11-0_sample


week11-1_TRT_again

複習小考要考的TRT轉動

1.新增專案取名成week11-1_TRT_again

2.貼上week10-1_glutWireCube_myBody_myArm程式

3用小考T-R-T轉動來修改

glPushMatrix();

    glTranslatef();//(3)

    glRotatef();//(2)

    glTranslatef();//(1)

    myArm();

glPopMatrix();





week11-2_glm_gundom_opencv_texture_lighting

下載OpenCV

1 選第2或3選項別選第1個

2 安裝在預設的目錄

3 重開CodeBlocks(讓編譯器讀到檔案)

4.0 去設定 Settings->Compiler 要加3個設定

4.1 search目錄 Compiler的 include目錄  加C:\OpenCV2.1\include

4.2 search目錄 Linker 的 lib目錄  加C:\OpenCV2.1\lib

4.3 加入Linker設定的 3個檔名 cv210 cxcore210 highgui210

5.0 git指令下載檔案

        cd desktop    ->    git clone https://github.com/sssrrr0987/2024graphicsa/

        ->    cd 2024graphicsa/    ->     start .

5.1 week09-1_glm_gundom_opencv_texture_lighting改成week11-2

    (檔案裡的Title也要改去properties改)


用Maya切割OBJ檔、匯出OBJ檔

6 把handA.obj、handA.mtl 、handB.obj、handB.mtl    放到data資料夾

7 改程式碼 GLMmodel * pmodel = NULL新增

GLMmodel * handA = NULL;

GLMmodel * handB = NULL;


void myBody(){///我的身體

    glPushMatrix();

        glColor3f(1, 0, 0);///紅色的

        glutSolidCube(0.6);///myBody()

    glPopMatrix();

}

    glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

    glDisable(GL_TEXTURE_2D);

    myBody();

    glEnable(GL_TEXTURE_2D);

    glColor3f(1, 1, 1);



Github







沒有留言:

張貼留言