2024年6月6日 星期四

0606

 1.week16-0_sample

    準備上課的環境

    -freeglut

    -OpenCV

    -設定CodeBlocks

        Setting-Compiler要加入OpenCV相關的3個設定

        --compiler的include要加入C:\OpenCV2.1\include

        --linker的lib要加入C:\OpenCV2.1\lib

        --linker設定,要加入cv210 cxcore210 highgui210

    -新增GLUT專案

接下來,看課本程式

https://jsyeh.org/3dcg10/ 下載data、win32

eye是從哪裡

center是看哪裡

up是調整方向 

2.week16-1_sample_gluLookAt

    新增專案

    要改resize()函式 在裡面,加上gluLookAt函式

    現在要做另一個修改,想要在按按鍵時,看不同地方

    先把剛剛加的第39行註解,在void key裡改
3.week16-2_glut_
glutReshapeFunc_gluPerspective_gluLookAt

    先看課本範例Projection.exe

    gluPerspective透視投影

    glOrtho垂直投影

    glFrustum比較奇怪,我們通常不用他的投影法

    左、右、下、上、近、遠 共6組參數

    gluPerspective(視角,長寬高,z近,z遠)

    fovy field of view in y視角

    aspect ratio長寬比

    我們將要寫個程式,11行+8行,做出透視投影

        新增GLUT專案

        glutReshapeFunc_gluPerspective_gluLookAt

         貼上11行GLUT簡單程式碼

        在int main()哩,加入glutReshapeFunc(reshape);

        寫自己的void reshape(int w,int h)(...)


4.week16-3_myTexture_id1_id2_glBindTexture

    若想要有[兩張貼圖](一張背景、一張給模型)

    新增GLUT專案

    偷week05_rotating_earth/main.cpp裡的程式碼

    會出錯音沒圖檔

    把earth.jpg放在C:/earth.jpg




5.可用Notepad++觀察.obj檔看模型大小


沒有留言:

張貼留言