2018年5月4日 星期五

Week 10 texture

電腦圖學  2018-05-04   week 10
(1)主題:貼圖
(2)實作:OpenCV讀圖秀圖
(3)實作:OpenGL貼圖
(4)期中考試
(5)回家作業Week3截止Demo



一. 打開網址: jsyeh.org/3dcg10
       下載:windows.zip---->桌面/widows/Texture.exe
                data.zip---------->桌面/widows/fishmen.sgi
                glut32.dll-------->                       glut32.dll


二.OpenCV讀圖秀圖
      (1)moodle下載並安裝OpenCV-2.1.0-win32-vs2008.exe.-----------------最好用的
      (2)安裝過程中需要變更一個設置


       (3)打開codeblock,並建立GLUT專案
       (4)找到mian涵式 添加四行程式碼 (1-4) 
       (5) 此時程式還不能build and run,需要進行以下處理
                1.右鍵專案,點選Build options....


                 2.點選Search directories--->compiler----->添加OpenCV的include文件路徑               
                                (C:\OpenCV2.1/include)

                3.與2.類似分別在Linker和Resource compiler添加OpenCV的lib和bin文件路徑

              4.最後在Linker settings--->Link libraries添加cv210   cxcore210   和highgui210
                                (PS:這裡把cxcore210打成cvcore210了)
                                

       (6)最後我們選擇一張圖片放入freeglut\bin文件中並取名image.jpg
            build and run 即可
效果圖

三.製作一個地球
        (1)在moodle下載myEarth,解壓縮後用notepad++打開myEarth.cbp專案檔,把路徑改成小數點
             "C:/Users/USER/Desktop/freeglut/bin"----->"."
       (2)在freeglut/bin文件夾中找到freeglut.dll文件,並複製到myEarth文件夾中
                               
        (3)google一張earth map地圖,下載並命名為image.jpg,放在myEarth資料夾中
        (4)用codeblock打開myEarth.cbp專案,重複二(5)的動作,並且添加freeglut中的include和bin資料夾在compiler和Linker即可,build and run
                               




















沒有留言:

張貼留言