2024年4月15日 星期一

week099999999999999

 

##程式碼重新再利用

0.安裝 Git 軟體

1.將Github上周的程式 clone下來(先有程式碼)

-在小黑 Git Bash 裡指令:

-cd desktop (先進入桌面)

-git clone https://github.com/fangg03/2024garphicsb

-cd 2024graphicsb

-start .

2.確認環境沒問題

-安裝 OpenCV 要勾Add PATH, 裝在預設目錄

3.專案的設定需要修改

----------------------------------------

week09-1_gundam_texture_lighting_rotate

-----------------------

打光8行程式貼上

打光12+2行函式 glutMainLoop();貼到之上

glmDraw(pmodel, GLM_SMOOTH | GLM_TEXTURE);刪掉中間

打光加入旋轉



------------------------------------------------------------

#WEEK09-2_glutSolidCube_glutSolidTeapot_glutSolidSphere

0. 設定好 OpenCV-2.1, 要加PATH, 用預設目錄

1.重開 CodeBlocks, 設定貼圖的3個設定 Settings-Compiler

1.1. 在 Search directories 加入2個目錄

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

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

1.2.在 Linker setting 裡 ,加入3個 210 cxcore210 highgui210


模仿剛剛 week07-1的做法,全部都在做一次,

1.File-New-Project, GLUT專案 week07-2_obj_gundam_opencv_texture

2.把glm.cpp glm.h freeglut.dll Gundam.obj Gundam.mtl 放入這個目錄

3.再把 Diffuse.jpg 與放進去

4.貼入 week07-1 的程式碼

最後,最前面加入myTexture 對應的18行程式

---------------------------------------------------------------

#week09-3_glutWireCube_glutWireTeapot_glutWireSphere

1.新增glut專案   week09-3_glutWireCube_glutWireTeapot_glutWireSphere
2.貼上上一個程式 新增Wire程式



沒有留言:

張貼留言