2017年10月12日 星期四

Claire's Note #5

WEEK05

Topic:

  1. 複習上週主題:移動、旋轉、縮放
  2. 主題:Viewing相關函式&介紹
  3. 範例:jsyeh/3dcg10
  4. 作業:利用mouse / keyboard實作

A. 複習上週主題:移動、旋轉、縮放

STEP 1: 下載範例檔

下載data.zip、windows.zip、glut32.dll

STEP 2: Unzip


解壓縮後將data、glut32.dll放入windows中


STEP 3: 執行範例檔Transformation.exe




B. 範例:Viewing

STEP 1: 承A. 執行範例檔Projection.exe


STEP 2: 更改參數

透視投影法
gluPerspective(fovy, aspect, zNeer, zFar)
    視野, y/x比例
gluLookAt(eyeX, eyeY, eyeZ,
centerX, centerY, centerZ,
upX, upY, upZ)
*eye:改變視角
center:依中心點改變觀看角度
up:旋轉視角


垂直投影法
glOrtho(left, right, bootom, top, near, far)


透視視野
glFrushum(left, right, bottom, top, near, far)

*範例檔程式碼
去除顏色與打光之程式碼

沒有留言:

張貼留言