-
Notifications
You must be signed in to change notification settings - Fork 17
Building OpenSceneGraph on Ubuntu
Ravi Mathur edited this page Apr 2, 2020
·
22 revisions
The following dependencies are needed to build OpenSceneGraph and its associated plugins
sudo apt install build-essential
sudo apt install git
sudo apt install cmake-
sudo apt install cmake-qt-gui(for cmake-gui, an easy-to-use cmake GUI)- Alternatively,
sudo apt install cmake-curses-gui(for ccmake, a text-based cmake UI)
- Alternatively,
sudo apt install mesa-common-devsudo apt install freeglut3-dev
sudo apt install libfreetype6-dev fonts-liberationsudo apt install libpng-dev libjpeg-dev libtiff-dev
(Optional) Qt
- download
.runinstaller -
chmod +x *.runin the Terminal ./<RUNFILE>.run- follow on-screen instructions to install
- Qt install path with be referred to as
[QT_ROOT]by this wiki
-
git clone https://github.com/openscenegraph/OpenSceneGraph.git --branch OpenSceneGraph-X.X.XwhereX.X.Xis replaced by the latest stable tag under Branch > Tags on Github - the root OpenSceneGraph directory will be referred to as
[OSG_ROOT]by this wiki
In Terminal:
cd [OSG_FOLDER]mkdir buildmkdir installcd buildcmake ..-
cmake-gui(alternativelyccmake .)- Enable "Grouped" and "Advanced" options
- Set
CMAKE_INSTALL_PREFIX=[OSG_FOLDER]/install - (Optional)
BUILD_OSG_EXAMPLES=ON - Ensure that
OPENGL_INCLUDE_DIR,OPENGL_gl_LIBRARY, andOPENGL_glu_LIBRARYwere found - Configure, then Generate
In Terminal:
-
cd [OSG_FOLDER]/buildif you aren't already there -
makeormake -j <NUMBER_OF_CORES>if you know the number of cores your computer has -
sudo make installto install the compiled OpenSceneGraph into the[OSG_FOLDER]/installfolder - Confirm that the
osgversionexecutable is in[OSG_FOLDER]/install/bin
In Terminal:
- Add the following to your
.bashrclogin file
export OSG_ROOT=[OSG_FOLDER]/install
export PATH=$PATH:$OSG_ROOT/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OSG_ROOT/libsource ~/.bashrc- Run
osgversionin the Terminal, it should tell you the version of OpenSceneGraph that you have installed
Congratulations, OpenSceneGraph is now built and installed; ready for use with OpenFrames!
- Download the resources from here
- Unzip the files
-
cdto the unzipped directory -
osgviewer cow.osg --window 0 0 640 480to run a demo visualization of a cow