2024年5月13日 星期一

week13 凱

 week 13 


##week13-1_keyboard_angleID_mouse_motion_angle

0. 安裝 freeglut,將lib\libfreeglut.a複製成libglut32.a

1.安裝openCV2.1, 要勾Add PATH,裝在預設目錄

2.Setting Compiler裡,3個設定設好

-Compiler 加入C:\OpenCV2.1\include

-Linker加入C:\OpenCV2.1\lib

-Linker setting裡,加入3個 cv210 cxcore210 highgui210


準備專案

1.下載 week12-3_obj_gundam_body_upper_lower

2.複製目錄成 week13-1_keyboard_angleID_mouse_motion_angle

.cbp 改檔名 week13-1_keyboard_angleID_mouse_motion_angle.cbp 

再用Notepad++開它,改week13-1_keyboard_angleID_mouse_motion_angle

3.用codeblocks開.cbp檔





##week13-2_many_angle

1.把剛剛的week13-1_keyboard_angleID_mouse_motion_angle 存檔,複製目錄成week13-2_many_angle

2.改目錄名,改.cbp檔,用Notepad++改cpb檔案的內容,變成week13-2_many_angle

再開啟maya把,gundam模型,裁切出另一個手臂的upper2.obj lower2.obj 並產生對應的upper2.mtl lower2.mtl


week13-3_FILE_fopen_fprintf_fscanf

{

    glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

    glPushMatrix();

        glRotatef(180,0,1,0);

        drawBody();

        glPushMatrix();

            glTranslatef(-0.15,0,0);


            glRotatef(angle[0],1,0,0);

            glRotatef(angle[1],0,1,0);

            glRotatef(angle[2],0,0,1);


            glTranslatef(-0.025,-0.05,0);

            drawUpper();

            glPushMatrix();


                glTranslatef(0,-0.2,0);

                glRotatef(angle[3],1,0,0);

                glTranslatef(-0.02,-0.2,0);

                drawLower(); ///glutSolidTeapot( 0.3 );

            glPopMatrix();

        glPopMatrix();

    glPopMatrix();

    glutSwapBuffers();


}

沒有留言:

張貼留言