2024年5月30日 星期四

week15電腦圖學

 

 Week15

1. 先設定好環境

2. 安裝 freeglut 再把 lib\libfreeglut.a 複製成 libglut32.a

3. 安裝 opencv 2.1, 記得要 Add PATH, 不要設目錄

4. 關閉重開 CodeBlocks (才會把 PATH 設定設好 要記得存檔)

5. -Search directories 的 Compiler 對應 C:\OpenCV2.1\include

6. -Search directories 的 Linker 對應 C:\OpenCV2.1\lib

7. -Linker setting 要加 cv210 cxcore210 highgui210

week15-1_PlaySound

1. File-New-Project, GLUT 專案 week15-1_PlaySound

2. 新增兩行程式碼


3. 加入其他音效



week15-2_PlaySound_empty

1. File-New-Project, GLUT 專案 week15-2_PlaySound_empty

2. 把程式碼全部刪光



3.現在要到week15-1修改程式


4. 把原本的註解掉




5. 把你的工作執行目錄 Project-Properties的第2分頁 Execution working dir改成小數點


6. 再把桌面 \freeglut\bin\freeglut.dll 及音樂, 都copy到專案目錄


week15-3_CMP3_MCI

1. File-New-Project, GLUT 專案 week15-3_CMP3_MCI

2. 請把 CMP3_MCI.h 和 song.mp3 放到你的專案目錄裡

3.把你的工作執行目錄, 設成小數點


week15-4_mouse_motion_translate_rotate

1. File-New-Project, GLUT 專案 week15-4_mouse_motion_translate_rotate

2.貼上11行程式碼

#include <GL/glut.h>
void display()
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glutSolidTeapot(0.3);
    glutSwapBuffers();
}
int main(int argc, char*argv[])
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
    glutCreateWindow("week09 Microsoft Visual Studio");
    glutDisplayFunc(display);
    glutMainLoop();
}

3. 目標: 先能移動, 旋轉, 陣列

4.以下兩張為移動程式碼


5. 接下來做旋轉














沒有留言:

張貼留言