LoginSignup
17
9

More than 5 years have passed since last update.

UbuntuでopenFrameworksの開発環境を構築する。

Last updated at Posted at 2017-05-19

目的

UbuntuでOpenFrameWorks開発環境を構築する。

環境

Ubuntu16.04(x64) , Ubuntu14.04(x64)
openFrameworks ver0.9.8

openFrameworksとは

http://openframeworks.cc/ja/
「創造的なコーディング」のためのC++のオープンソースツールキット。下記のライブラリを包括した開発環境を提供する。Addonで機能拡張できる。
- グラフィクス:OpenGL, GLEW, GLUT, libtess2, cairo
- オーディオの入出力と分析:rtAudio, PortAudio, OpenAL, Kiss FFT または FMOD
- フォント:FreeType
- イメージの読込と保存:FreeImage
- 動画の再生と取込:Quicktime,GStreamer, videoInput
- 様々なユーティリティー:Poco
- コンピュータビジョン:OpenCV
- 3Dモデルの読み込み:Assimp

openFrameworksのインストール

Linux installのチュートトリアルに従ってインストールする。
http://openframeworks.cc/ja/setup/linux-install/

openFrameworks本体をダウンロード・解凍する。

wget http://openframeworks.cc/versions/v0.9.8/of_v0.9.8_linux64_release.tar.gz
tar xvfz of_v0.9.8_linux64_release.tar.gz
mv of_v0.9.8_linux64_release of_v0.9.8_linux64
cd of_v0.9.8_linux64/scripts/linux/ubuntu

必要なライブラリをインストールする。

sudo ./install_dependencies.sh
sudo ./install_codecs.sh

openFrameworksをコンパイルする

cd of_v0.9.8_linux64/scripts/linux
./compileOF.sh -j3
cd of_v0.9.8_linux64/examples/graphics/polygonExample
make
make run

projectGeneratorをインストールする。
あらかじめ、eclipseとqtcreatorをインストールする。

sudo apt-get install -y qtcreator eclipse
cd of_v0.9.8_linux64/scripts/linux
./compilePG.sh

Addonを入手する

メジャーどころのAddonを一気に入れる。
Windowsの場合Addon追加は手作業になるが、Linuxなら一括でできる。

ofxFaceTracker/ofxUI/ofxCv/ofxDatGui/ofxTimeline/ofxFX/ofxBox2d/ofxFlowTools/ofxImGui/ofxStateMachine
http://ofxaddons.com/popular

cd of_v0.9.8_linux64/addons/
git clone https://github.com/kylemcdonald/ofxFaceTracker
git clone https://github.com/rezaali/ofxUI
git clone https://github.com/kylemcdonald/ofxCv
git clone https://github.com/braitsch/ofxDatGui
git clone https://github.com/YCAMInterlab/ofxTimeline
git clone https://github.com/patriciogonzalezvivo/ofxFX
git clone https://github.com/vanderlin/ofxBox2d
git clone https://github.com/moostrik/ofxFlowTools
git clone https://github.com/jvcleave/ofxImGui
git clone https://github.com/neilmendoza/ofxStateMachine
git clone https://github.com/kylemcdonald/ofxTiming.git

projectGeneratorで、'std::regex_error'エラーが発生する

Ubuntu1404標準のGCC4.8でのある場合、
'std::regex_error'エラーが発生する。GCCを4.9へアップデートする。
エラーが発生しない場合は飛ばす。

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.9

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20
sudo rm /usr/bin/cpp
sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-4.8 10
sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-4.9 20
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++

参考:
Github Issue :Project Generator broken on Ubuntu #4575
Ubuntu 14.04 に GCC 4.9 をインストールする

ofxCVを差し替える

UbuntuにOpenCV3が入っている場合、ofxCVはOpenCV2準拠なのでエラーが発生する。

Use of undeclared identified 'glm'
とコンパイルエラーが発生する。OpenCV3対応のofxCvと差し替える
https://github.com/kylemcdonald/ofxCv/tree/stable

サンプルを入手する

多摩美大 田所先生の講義資料をコピーする。大量のサンプルを入手できる。

多摩美術大学 Media lab 2015 プロジェクトページ/http://yoppa.org/tau_media15

cd of_v0.9.8_linux64/
git clone https://github.com/tado/idd_medilab15

多摩美術大学 クリエイティブ・ビジュアライゼーションWS 2016年度前期講義/http://yoppa.org/tau_media16

cd of_v0.9.8_linux64/
https://github.com/CreativeVisualization/2016

Andreas Müller氏のGPUを使ったEffectのサンプルを入手する。

cd of_v0.9.8_linux64/apps
git clone https://github.com/andreasmuller/NoiseWorkshop
17
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
9