2024年4月15日 星期一

期中考沒100我跳海

 #week09


##week09-0_sample

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

1.File-New-Project,GLUT專案,week09-0_sample


##程式碼重新利用

1.下載上週程式碼 安裝github

-在小黑裡指令:

-cd desktop

-git clone https://github.com/你的帳號/2024graphicsb

-cd 2024graphicsb

-start


2.確認環境沒問題

- 安裝openCV 要勾add path, 裝載預設目錄

-setting-compiler裡 把openCV三個設定好

-上方第三個分頁 Search directories 裡

 - Compiler TH C: \OpenCv2.1\include - Linker JI C: \OpenCV2.1 Lib 

-上方第二個分頁 Linker Setting - cv210 cxcore210 highgui210 24 

-重新開啟 CodeBlocks

3.專案設定修改(seting-compiler...)


##開啟上週專案week07-2_obj_gundam_opencv_texture

1.file open, 點選剛剛下載的git 下載的 week07-2_obj_gundam_opencv_texture

-C:\User\adminidtrator\Desktop\2024grapgicsb\week07-2_obj_gundam_opencv_texture


##week09-1_obj_gundam_opencv_texture_lighting

-上週程式專案拿出來

-week07-2目錄打開 更改檔名 cbp檔

-打光的8行陣列 貼在程式上

-打光12+2行函式 貼到glutMaunLoop()

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

-打光  加入旋轉






#week09-2_glutSolidCube_glutSoildTeapot_flutSoildSphere

1.新增glut專案 week09-2_glutSolidCube_glutSoildTeapot_flutSoildSphere
2.貼入11行程式

##10行程式
#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("week06-1_lighting");
    glutDisplayFunc(display);
    glutMainLoop();
}



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




沒有留言:

張貼留言