2024年5月16日 星期四

week13


先準備上課的環境
freeglut 安裝
OpenCV2.1 安裝(Add PATH)
重開codeblocks設定Compiler-Setting
C:\OpenCV2.1\include
C:\OpenCV2.1\lib
cv210 cxcore210 highgui210


再把上周的week12-3拿來用
改目錄名,改.cbp名,改.cbp的內容Title
把float angle=0;改成


week13-2_FILE_fopen_fprintf_fscanf
把week13-1複製整個目錄,
改目錄名,改.cbp,Notepad++裡面的Title
要加FILE指標

FILE * fin = NULL;
FILE * fout = NULL;

在motion()裡,要加一段程式

void motion(int x,int y){
angle[angleID] += y-oldY;
oldX=x;
oldY=y;
glutPostRedisplay();
if(fout==NULL) fout = fopen("angle.txt"

你執行程式,用 mouse motion   一邊改變角度,一邊大量產生角度值
小黑關掉後,可在目錄裡,看到angle.txt裡面就是剛剛印的一堆數值
小心angle.txt裡面要有空格,不然就錯了 printf ()及() 要加"%.lf"

















 

沒有留言:

張貼留言