1.從上課軟體下載freeglut
2.將壓縮檔解壓到桌面
3.點開freeglut後復製其連結
4.點開lib後將freeglut.a復製
5.改名為libglut32.a (124KB)
6.到codeblock開新的專案 file > project,(檔名為week13-0)
7.opencv安裝
8.選項選2或3
9.不要更換目標資料夾
10.重開codeblocks
11.設定Settings-compiler要加入三個設定
11.1.search 目錄 compiler 的include 目錄 加 C:\OpenCV2.1\include
12.將剛剛的專案,先關起來Close Project (不然會被鎖),將目錄從14-2複製到15-1,新檔案名改為15-1,最後再把專案的Title改成 week15-1,用notepad++打開cbp檔把裡面week14-2改為week15-1
13.到codeblock開新的專案 file > project,(檔名為week15-1_PlaySound)
14.加上可以撥放聲音的程式碼17.只用幾行程式碼就可以撥放音樂
19.到codeblock開新的專案 file > project,(檔名為week15-3_CMP3_MCI)
20.將cmp3_MCI.h和sone.mp3放到專案裡面21.將工作執行目錄設定小數點,把freeglut也拉到資料夾裡面
22.可以撥放MP3的檔案
23.到codeblock開新的專案 file > project,(檔名為week15-4_mouse_motion_translate_rotate)24.貼上11行glut程式碼
#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("week15-4");
glutDisplayFunc(display);
glutMainLoop();
}
沒有留言:
張貼留言