week15
1-2 安裝GitBash,開啟專案 week15-1_gluLookAt
1-3 修改程式碼,讓專案也可移動視角
2-1 在範例中右鍵嘗試垂直投影glOrtho( ),透視投影glFrustum( ),glPersepective( )
2-2 開新專案 week15-2_Persepective
原本的glFrustum( ),透視,兩側較傾斜
glOrtho( ),變正了gluPerspective( )
static void resize(int width, int height){ ///step02-2 aspective ratio 長寬比 const float ar = (float) width / (float) height; glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION);///step02-2 切換成投影矩陣 glLoadIdentity(); ///glFrustum(-ar, ar, -1.0, 1.0, 2.0, 100.0); glOrtho(-ar*3,ar*3,-1.0*3,1.0*3,2.0,100.0);///step02-2 *3看到全貌 gluPerspective(60,ar,0.01,1000);///step02-2
glMatrixMode(GL_MODELVIEW);///step02-2 切換成model view矩陣 glLoadIdentity() ;///step02-2 設成單位矩陣}3 備份git status 紅色git add . 加進帳冊git status 綠色git config --global user.email git config --global user.namegit commit -mgit push4-1 開新專案week15-3_gluPerspective_gluLookAtvoid motion( )
static void resize(int width, int height){ ///step02-2 aspective ratio 長寬比 const float ar = (float) width / (float) height; glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION);///step02-2 切換成投影矩陣 glLoadIdentity(); ///glFrustum(-ar, ar, -1.0, 1.0, 2.0, 100.0); glOrtho(-ar*3,ar*3,-1.0*3,1.0*3,2.0,100.0);///step02-2 *3看到全貌 gluPerspective(60,ar,0.01,1000);///step02-2
glMatrixMode(GL_MODELVIEW);///step02-2 切換成model view矩陣 glLoadIdentity() ;///step02-2 設成單位矩陣}3 備份git status 紅色git add . 加進帳冊git status 綠色git config --global user.email git config --global user.namegit commit -mgit push4-1 開新專案week15-3_gluPerspective_gluLookAtvoid motion( )











沒有留言:
張貼留言