week09
##week09-0_sample
0. 桌面安裝 freeglut , 把 lib 的 libfreeglut.a 複製成 libglut32.a
1. File-New-Project , GLUT 專案 week09-0_sample
##複習上週的 week08-3_glm_gundam_opencv_texture_lighting
要把環境設好:OpenCV
1. 桌面上有葉正聖老師上課用軟體
2. 小心: Add PATH
3. 小心: 目錄不要改
4. 要重開CodeBlocks
CodeBlocks: Setting -> Compiler
1. C:\OpenCV2.1\include
2. C:\OpenCV2.1\lib
3. cv210 cxcore210 highgui210要把上週的 GitHub 倉庫複製下來
0. 安裝 Git , 開啟 Git Bash 小黑
1. cd desktop
2. git clone https://github.com/koukuanling/2024graphicsa
3. cd 2024graphicsa
4. start .
把上週的 week08-3_glm_gundam_opencv_texture_lighting 開起來
1. File - Open , 到那個目錄 , 點開 .cbp (CodeBlock Project 檔) 順手存檔Yes
2. Build & Run !
##把剛剛的專案,變成 week09-1_glm_gundam_opencv_texture_lighting
把剛剛的專案, 先關起來Close Project (這樣才不會被鎖)
1. 目錄: 把整個 week08-3_glm_gundam_opencv_texture_lighting 複製到桌面
重新命名成 week09-1_glm_gundam_opencv_texture_lighting
2. 檔案: 把新目錄裡的專案檔 week08-3_glm_gundam_opencv_texture_lighting.cbp
改檔名變成 week09-1_glm_gundam_opencv_texture_lighting.cbp
3. CodeBlocks File-Open 開啟 week09-1_glm_gundam_opencv_texture_lighting.cbp檔
4. 再把專案的 Title 改成 week09-1_glm_gundam_opencv_texture_lighting
(Notepad++改好三個地方後 , 直接開啟 , 可省略這步)
就是用Notepad++ 開啟 week09-1_glm_gundam_opencv_texture_lighting.cbp檔, 把三個
week08-3改成 week09-1 ,記得存檔
5. 再用 CodeBlock 開啟!
1. File-New-Project , GLUT 專案 week09-2_glutSolidTeapot_glutSolidCube_glutSolidSphere
2.貼上GLUT 程式 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. glutSolidTeapot(0.3); 改成 glutSolidCube(0.3);
沒有留言:
張貼留言