I07: render
主講人: jserv / 課程討論區: 2020 年系統軟體課程
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
返回「進階電腦系統理論與實作」課程進度表
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
預期目標
- 學習數值系統:浮點運算和定點數
- 以 C 語言為基礎的物件導向程式設計
- 視窗程式開發
- 事件驅動的程式設計
raycaster
raycaster 程式實作《毀滅戰士》(Doom) 系列遊戲中經典的 ray casting 並確保光線追蹤的算繪 (render) 完全不用除法操作。原始程式碼約 500 行,透過 SDL2 達到跨平台圖形處理,已在 macOS 和 Ubuntu Linux 測試過。
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
左圖是 fixed-point 實作,右圖是 floating-point 實作,可見到右圖的算繪 (render) 效果不理想,預期應該是連續牆壁投影
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
注意用語,"render" 一詞在多個領域都存在,例如口語的 "Render a Wall" 是「粉刷牆壁」的意思 (這裡不該出現「渲染」),在資料庫領域中,對資料進行操作時,"render" 和 "process" 同等意思,都是對指定的資料欄位或範圍予以處理。
關於翻譯用語討論,可參見 論 Render 翻譯(算繪/演繹)。在本專案中,我們將 "render" 翻譯為「算繪」。
raycaster 程式支援的按鍵:
- 向上 (arrow up): 前往更深處
- 向下 (arrow down): 自深處離開
- 向左 (arrow left): 左轉
- 向右 (arrow right): 右轉
Esc
: 離開本程式
前述方向按鍵按壓後,遊戲的視角會隨之變動。可嘗試透過方向鍵變更位置和視角,請留意到畫面左側 (fixed-point 實作) 和右側 (floating-point 實作) 的算繪結果差異。
延伸閱讀:
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
作業要求
繳交方式
編輯 Homework5 作業區共筆,將你的觀察、上述要求的解說、應用場合探討,以及各式效能改善過程,善用 gnuplot 製圖,紀錄於新建立的共筆
截止日期
越早在 GitHub 上有動態、越早接受 code review,評分越高