2015年4月6日 星期一

Raspberry Pi: Pi Mapper

since: 2015/04/09
update: 2015/04/09
reference:
1. Raspberry Pi: DHCP Wireless Network
2. Raspberry Pi: openFrameworks
3. PiMapper

-----------------------------------------------------------------------------------------------

A. 說明:
    1. Pi Mapper:
        Open source projection mapping tool that runs on the Raspberry Pi.

    2. 依照 Raspberry Pi: DHCP Wireless NetworkRaspberry Pi: openFrameworks  
         做好前置作業.

-----------------------------------------------------------------------------------------------

B. 安裝 ofxPiMapper:
     1. 取得 ofxPiMapper 的安裝軟體.
         $ cd ~/openFrameworks/addons
         $ git clone https://github.com/kr15h/ofxPiMapper.git

     2. 安裝相依軟體:
         $ git clone https://github.com/jvcleave/ofxOMXPlayer.git && git clone https://github.com/bakercp/ofxIO.git

     3. (選擇性) 讓鍵盤滑鼠運作正常:
         $ sudo apt-get update && sudo apt-get dist-upgrade
         $ sudo rpi-update // Raspberry Pi firmware update
         $ sudo reboot // 重新開機


     4. 編譯 ofxPiMapper:
         $ cd ~/openFrameworks/addons/ofxPiMapper/example
         $ make (約 1 個小時)
         $ make run // 執行

-----------------------------------------------------------------------------------------------

C. 模式與快捷鍵:
     a. 模式:(按下鍵盤的數字鍵)
          1. Presentation mode (預設, 展示上次儲存的)
          2. Texture mapping mode (調整外觀的紋理座標)
          3. Surface editing mode (選擇你所建立的外觀, 移動或變形)
          4. Source assignment mode (選擇外觀的來源)

          說明: 一般的步驟為: 
                   -> 先切換到模式3來選擇外觀.
                   -> 隨後, 便可以在模式2編輯紋理並於模式4選擇來源.

     b. 快捷鍵:
         鍵名                          功能
                                          Show info
                                         Add triangle surface
                                         Add quad surface
            f                               Toggle fullscreen
            s                              Save composition
            BACKSPACE        Delete surface

           說明: 可藉由編輯 app.cpp 檔案來指定快捷鍵.

-----------------------------------------------------------------------------------------------

D. 備註:
     1. 預設外觀設定檔:
         /home/pi/openFrameworks/addons/ofxPiMapper/example/bin/data/defaultSurfaces.xml

     2. 使用者外觀設定檔:
         /home/pi/openFrameworks/addons/ofxPiMapper/example/bin/data/surfaces.xml

     3. 圖片來源檔位置: (支援: .png .jpg .jpeg)
         /home/pi/openFrameworks/addons/ofxPiMapper/example/bin/data/sources/images/
         image1.jpg, image2.jpg, image3.jpg ....

     4. 影片來源檔位置: (支援: .mp4 .h264 .mov .avi .mpeg)
         /home/pi/openFrameworks/addons/ofxPiMapper/example/bin/data/sources/videos/
         test.mov ....

     5. 讓 HDMI 影片的聲音正常播放:(修改以下二項設定後, 重新開機編譯)
         a. /boot/config.txt
             ....
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes

hdmi_drive=2
             ....

         b. /home/pi/openFrameworks/addons/ofxPiMapper/src/Sources/VideoSource.cpp
            ....
            #ifdef TARGET_RASPBERRY_PI
            // Do things with the OMX player
            ....
            //settings.enableAudio = false;        //default true, save resources by disabling

            settings.enableAudio = true;        //default true, save resources by disabling           
            ....

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。