Difference between revisions of "CalVR"

From Immersive Visualization Lab Wiki
Jump to: navigation, search
(Overview)
(Coin3d)
 
(125 intermediate revisions by 5 users not shown)
Line 1: Line 1:
----
+
=Overview=
  
== This page is working in Progress ==
+
This wiki page was created to give programmers an overview of how to use IVL's virtual reality visualization framework CalVR. Special emphasis is given to those programmers who already know how to write code for COVISE.
  
----
+
If you just want to use CalVR, you can build it from source at [https://github.com/CalVR/calvr this GitHub link].
  
 +
==What is CalVR?==
  
== Overview ==
+
CalVR is a virtual reality framework which has been entirely developed in the Immersive Visualization Laboratory at Calit2. It is designed to be open source and royalty free, for non-profit use. CalVR implements the typically used VR functionality of middleware such as CAVElib, COVISE, VRUI or FreeVR and adds to it by supporting nonstandard VR systems like autostereoscopic displays, as well as multi-user support for viewing and interaction. CalVR is entirely object oriented and written in C++. Functionality can be added through a simple plug-in system which allows compiling new modules separately from the main code. CalVR has built-in navigation algorithms, a 3D menu system, support for a variety of 3D display and tracking systems, as well as support for collaborative work at different sites. The campus wide visibility of Calit2’s Immersive Visualization Laboratory (IVL) has allowed the group to engage in a large variety of software application research and development with groups from many of UCSD’s departments. The experience from more than six years of campus-wide collaborations and many publications reporting on those projects both in the virtual reality community and also the domain sciences is flowing into the design and development of the CalVR software framework.
  
This page talks about adding a new plugin for CalVR, starting from building OSG and CalVR from source. You need [http://www.cmake.org/cmake/resources/software.html cmake] to build OSG, CalVR and your plugins.
+
==CalVR Specification and Features==
  
== Building OSG ==
+
* Operating system:
 +
** Developed for [http://www.centos.org/ CentOS] Linux
 +
** Also builds for other Linux flavors, for instance SuSe
 +
** Mac OS X: experimental, not always tested
 +
** Windows: limited to single node
 +
* Programming language: C++
 +
* Graphics API: [http://www.openscenegraph.org OpenSceneGraph] (OSG)
 +
** Preferred 3D model file format: VRML, parsed by OSG's Coin3D library
 +
* Build system: [http://www.cmake.org/cmake/resources/software.html CMake]
 +
* XML configuration file for display layout, software parameters, plugin parameters
 +
** Supports Twinview, Xinerama, separate X displays
 +
* Tracking APIs supported: [http://www.cs.unc.edu/Research/vrpn/ VRPN], [http://www.mechdyne.com/trackd.aspx TrackD], [http://code.google.com/p/omicron-sdk/ Omicron (UIC/EVL)]
 +
** Multiple tracked heads and hands supported
 +
** Support for tracked head-mounted displays
 +
** Per-screen fixed cameras are possible
 +
* PC cluster support
 +
** Synchronization over Ethernet, 1+ Gbps preferred
 +
** Each cluster node runs a copy of CalVR
 +
** CalVR on cluster nodes run by remote ssh call from head node
 +
** Buffer swap synchronized over Ethernet
 +
* Support for multi-screen virtual reality systems
 +
** Stereo modes supported: all OSG supported modes (passive, quad-buffer, interlaced), 8-view autostereoscopic displays, mirrored displays
 +
* Support for sound effects through audio server
 +
* Support for collaborative sessions to link multiple VR systems over IP networks
 +
* Separation of core framework code and application development through plug-in system
 +
** Plug-ins are compiled independently of core code into shared object files
 +
* Coordinate system: z coordinate is up
 +
* Two GUI widget libraries supported, clean API for additional libraries
 +
** Functionality abstracted from GUI widget implementation
  
 +
=Building CalVR=
  
Developer release of OSG can be found [http://www.openscenegraph.org/projects/osg/wiki/Downloads/DeveloperReleases here]
+
The project is built with [http://www.cmake.org/ cmake].  At the moment, it is set to require at least version 2.8.
  
Assume the unpacked directory is osg/, and cmake/bin/ is in the path, in osg/ run ccmake:
+
==Dependencies==
ccmake .
+
It turns into a terminal interface of cmake config for osg.
+
  
In CMAKE_BUILD_TYPE, press Enter to edit the field, type in one of the options that with debug information: RelWithDebInfo
+
The major external libraries needed are:
 +
<br>Latest stable release of [http://www.openscenegraph.org/index.php/download-section/stable-releases OpenSceneGraph]. These instructions have been updated for version 3.6.2.
 +
<br>Latest [http://www.minixml.org MiniXML]
 +
<br>
 +
<br>Optional Libraries that add additional features:
 +
<br>[http://www.cs.unc.edu/Research/vrpn/ VRPN] - Needed for vrpn tracking support - version 7.29 was that last I tested, though higher probably works.
 +
<br>Interleaver - A research library used to render lenticular screens - I will post a copy or add to source when I get permission.
  
press 'c' to configure, press 'g' to generate. and 'q' to quit. Now back to osg/, just type make to build. It takes quite a while to build.
+
===Building OSG===
  
== Building CalVR ==
+
Download OSG from the above link.
 +
<br>Go to main OSG directory and type <tt>ccmake .</tt>
 +
<br>In CMAKE_BUILD_TYPE, press Enter to edit the field, type in one of the options with debug information: RelWithDebInfo
 +
<br>On Mac OS X, set OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX to "imageio" and OSG_WINDOWING_SYSTEM to "Cocoa".
 +
<br>Press 'c' to configure, press 'g' to generate. and 'q' to quit. Now type <tt>make</tt> to build. Go get coffee.
  
 +
=====OSG Extra Libraries=====
 +
There are a number of extra libraries that are optional, but can be built into osg to add additional functionality.  This is done by building/installing the libraries then setting the include/library path values in the osg ccmake window.  When all paths are added, configure, generate the makefiles, and compile.
  
Make sure CalVR Dependencies(OSG, MXML, GLEW) are in the environment variables. If not, set them in .cshrc, for example, adding OSG in the environment, add this line at the ned of .cshrc:
+
=====simage=====
setenv OSG_HOME ~/osg/
+
  
 +
Download simage 1.7.0: https://bitbucket.org/Coin3D/coin/downloads/simage-1.7.0.tar.gz
  
Run cmake/bin/cmake-gui, let CalVR/ be both the source and binaries
+
If you get the error message "../../simage-1.7.0/src/simage_png.c:326:7: error: dereferencing pointer to incomplete type" then patch simage_png.c by replacing "if (setjmp(png_ptr->jmpbuf)) {" with "if (setjmp(png_jmpbuf(png_ptr))) {".
  
click Configure, select Unix Makefile, and it should show a configuration list for CalVR
+
If you want support for extra image types such as TIFF, JPEG, PNG, GIF or JPEG2000, we recommend the following package installs before running configure:
 +
<pre>
 +
sudo yum install libtiff-devel
 +
sudo yum install libjpeg-devel
 +
sudo yum install libpng-devel
 +
sudo yum install giflib-devel
 +
sudo yum install jasper-devel
 +
</pre>
  
Navigate to OSG-->OSG_LIBRARY, if it is NOTFOUND, you may need to point it to your osg/lib, this is an example input:
+
=====Coin3d=====
-L/home/hwang/CalVR/externs/osg/lib -losgFXrd -losgParticlerd -losgTextrd -losgSimrd -losgGArd -losgViewerrd -losgDBrd -losgShadowrd -losgUtilrd -lOpenThreadsrd -ldl
+
  
Note that many -losg*rd inputs, where are different than the IVL OSG_LIBRARIES, with extra "rd" tails.
+
Download Coin 3.1.3: https://bitbucket.org/Coin3D/coin/downloads/Coin-3.1.3.tar.gz
  
You may also turn on PLUGINS->PLUGINS_CALIT to build your plugin at the same time.
+
<br>This is a highly recommended library to add.  It adds VRML support to OSG.
 +
<br>If you want the VRML models to have texture support, you need to build coin with the simage library: https://bitbucket.org/Coin3D/simage
 +
<br>After you have configured/built/installed simage, configure Coin with a line something like this:
 +
configure --prefix=YOURINSTALLPATH --with-simage=YOURSIMAGEINSTALLHOME --disable-dl-simage
 +
If all went well, the final configure settings output should contain:
 +
simage linkage:  link-time binding
  
click Generate, when it is done, you may exit the gui.
+
If you get the error message "error: ‘cc_debugerror_post’ was not declared in this scope" then include the header
 +
<pre>
 +
#include <Inventor/C/errors/debugerror.h>
 +
</pre>
 +
at the beginning (after the #define) of the file Coin-3.1.3/include/Inventor/SbBasic.h
 +
 
 +
If you get errors about abs functions, add the following define to the src/base/dict.h file before the first header include
 +
<pre>
 +
#define __STRICT_ANSI__
 +
#define __CORRECT_ISO_CPP_STDLIB_H_PROTO
 +
</pre>
 +
 
 +
If you get the error message "/usr/lib/libGL.so: could not read symbols: File in wrong format":
 +
fix it in libtool, or temporarily rename to wrong libGL.so so the linker can't find it.
 +
 
 +
To build osg with Coin3D, define the INVENTOR_INCLUDE_DIR to point to the coin include directory and the INVENTOR_LIBRARY_RELEASE to point to the coin library.
 +
 
 +
=====LibTIFF-4=====
 +
ftp://ftp.remotesensing.org/pub/libtiff/
 +
Most versions of linux have libtiff installed.  The problem is that this is normally only version 3.X.  There are some features of tiff version 4 that are useful and required for some things.  It is recommended to build and compile against the latest tiff 4 version.
 +
<br>Note: in the cmake configuration tool, the tiff include/library variables are flagged as advance.  You will need to hit 't' to turn on advanced mode and change the entries.
 +
 
 +
=====COLLADA=====
 +
 
 +
Download [http://sourceforge.net/projects/collada-dom/files/Collada%20DOM/Collada%20DOM%202.2/Collada%20DOM%202.2.zip/download Collada 2.2] from the Collada server. Note that OSG 3.0.1 '''will not''' work with newer versions of Collada!
 +
 
 +
* Fix a bug, when in main Collada directory: mv dom/include/1.4/dom/domasset.h dom/include/1.4/dom/domAsset.h
 +
* cp Makefile.linux Makefile
 +
* Only build minizip and dom: in Makefile comment out lines for fx, rt and viewer.
 +
* make
 +
* Copy include files to your include directory:
 +
** mkdir /share/calvr/extlibs/include/collada-dom2.2
 +
** cp -r /share/calvr/extlibs/src/collada-dom-2.2/dom/include/* /share/calvr/extlibs/include/collada-dom2.2
 +
* Copy library files to your lib directory:
 +
** cp /share/calvr/extlibs/src/collada-dom-2.2/dom/build/linux-1.4/libcollada* /share/calvr/extlibs/lib
 +
* Add to .bashrc: export COLLADA_DIR=<prefix-dir>. <prefix-dir> is what you would normally put as --prefix= when configuring. Example: /share/calvr/extlibs
 +
* Run OSG's ccmake .
 +
* Make sure at least all COLLADA lines without DEBUG in them are filled out correctly.
 +
 
 +
===Getting the Code===
 +
 
 +
The CalVR repository is split into two sections, one of the framework and another for the plugins.
 +
 
 +
===GitHub===
 +
There are two ways to check out the CalVR source code from the GitHub repository: read-only and developer mode. Programmers who want to write CalVR plugins, but don't intend to modify the core should read-only checkout the core, and use the developer checkout method for the plugins.
 +
 
 +
====Read-Only Checkout====
 +
You can do a <i>read only</i> checkout by doing the following:
 +
git clone git://github.com/CalVR/calvr.git CalVR
 +
git clone git://github.com/CalVR/calvr_plugins.git CVRPlugins
 +
 
 +
====Developer Checkout====
 +
Developers at IVL who do not need to modify the core of CalVR should use the shared CalVR sources under /home/calvr/CalVR, and should check out the plugin sources from the GitHub repository into their home directories. Plugin developers outside of IVL should check out the read-only version of the core, and the developer version of the plugin code.
 +
 
 +
To check out code as a developer you first need to get permission from one of the CalVR administrators (Andrew Prudhomme, Philip Weber, Jurgen Schulze). Then you need to [https://github.com create a GitHub account]. Send your account name to an administrator to be added to the developer list.
 +
 
 +
Then, to pull down the CalVR plugin code from GitHub you need to do the following in your home directory (replace "username" with your GitHub name):
 +
 
 +
git clone https://username@github.com/CalVR/calvr_plugins.git CVRPlugins
 +
 
 +
If you're also working on the CalVR core code, pull it down like this:
 +
 
 +
git clone https://username@github.com/CalVR/calvr.git CalVR
 +
 
 +
==Building Core for Linux==
 +
 
 +
To help aid the cmake configure, you can optionally set environment variables for the location of these libraries:
 +
<br>OSG_HOME - location of OpenSceneGraph install, very good to set if cglx has a copy of osg in /usr/local
 +
<br>MXML_HOME - location of MiniXML install
 +
 
 +
Go to the project root and run
 +
ccmake .
 +
then type 'c' to configure.
 +
 
 +
If the configure doesn't find the core libraries, manually fill in the information.
 +
For OpenSceneGraph, fill in the OSG_HOME value and reconfigure.  This should fill in the OSG_INCLUDE_DIR correctly.  Note that this process also sets the library locations in hidden variables, so you can't just fill in the include directory manually.
 +
 
 +
There are also optional libraries that add additional fuctionality.
 +
<br>Interleaver - if present, builds the ability to create a screen for lenticular 3D rendering - TODO: upload src here
 +
 
 +
From the ccmake menu you can also select which plugins you want to build.  Turn those plugins on and reconfigure.  The configure will tell you if there are undetected additional libraries needed to build those plugins and the cmake variables for those libraries will now be in the main menu.
 +
 
 +
When you are done, select the option to generate and exit ccmake.
 +
 
 +
From here, run make.
 +
 
 +
===Building Plugins===
 +
The plugins are built in a similar way.  Go the the plugin root directory and run
 +
ccmake .
  
In CalVR folder, type make to build.
+
The plugins also need OpenSceneGraph and this can be set the same way as above.
 +
The plugins need to know where the CalVR home directory is.  This can either be manually set or it will look for the CALVR_HOME environment variable.
  
==Runing CalVR==
+
You can then toggle the plugins that you want to build on and reconfigure.  If there plugins have any dependencies, they will appear in the cmake config.
 +
<br>Now generate and run make.
 +
<br>Note: Different plugins have there own library and data dependencies.  See [[Plugin Configuration]].
  
Before runing CalVR you need to add osg/lib into your LD_LIBRARY_PATH in .cshrc
+
==Building Core for Windows==
  
Add an environment variable to .cshrc, for example:
+
The instructions for the Windows build are on a [[BuildWindowsCore | separate page]].
setenv CALVR_HOME /home/hwang/CalVR/
+
  
The entrance program is in CalVR/bin/CalVR
+
==CalVR Configuration==
  
==Adding a plugin for CalVR==
+
===Environment===
  
Take CalVR/plugins/calit2/ModelLoader as a start up example:
+
Before runing CalVR you need to add the library directories into your LD_LIBRARY_PATH in .cshrc/.bashrc. On Mac OS X, set DYLD_LIBRARY_PATH.
 +
<br>These directories should include the ${CALVR_HOME}/lib directory and any lib directories for the CalVR dependencies (i.e. osg/mxml/etc)
  
Make a new Copy of the ModelLoader folder, rename it to ExamplePlugin. Each directory hierarchy has files "CMakeLists.txt" and "cmake_install.cmake". In order for cmake to generate a make file for the new plugin, we need to add an entry to these cmake files in the parent directory, and modify the cmake files in the new plugin directory.
+
Add an environment variable to .cshrc/.bashrc, for example:
 +
<br>.cshrc
 +
setenv CALVR_HOME /home/calvr/CalVR/
 +
setenv CALVR_CONFIG_FILE config.xml
 +
.bashrc
 +
export CALVR_HOME=/home/calvr/CalVR/
 +
export CALVR_CONFIG_FILE=config.xml
  
Under parent directory, say CalVR/plugins/calit2/CmakeLists.txt, add the following lines:
+
===Config File===
OPTION(PLUGIN_EXAMPLEPLUGIN "ExamplePlugin" ON)
+
  
IF(PLUGIN_EXAMPLEPLUGIN)
+
Calvr uses an xml based configuration file.
  ADD_SUBDIRECTORY(ExamplePlugin)
+
<br>For more infomation on the config file, see: [[CalVR Config File]]
ENDIF(PLUGIN_EXAMPLEPLUGIN)
+
  
Under parent directory, say CalVR/plugins/calit2/cmake_install.cmake, find:
+
==Running CalVR==
IF(NOT CMAKE_INSTALL_LOCAL_ONLY)
+
add the following line (change to absolute path):
+
INCLUDE("~/CalVR/plugins/calit2/ExamplePlugin/cmake_install.cmake")
+
  
Under new plugin directory you may remove the CMakeFiles folder as well as the old Makefile which were copied from ModelLoader. There should be only two source files and two cmake files left. Modify these files to adapt the new plugin's name.  
+
The main CalVR executable is ${CALVR_HOME}/bin/CalVR.
  
Launch cmake, delete the cache if necessary, configure and generate again. Note that under the PLUGINS entry, the calit2 checkbox should be on, and you should be able to find your new plugin name under PLUGIN along with the ModelLoader.
+
Show rendering statistics:
 +
* Click on main rendering window on head node
 +
* Press Shift-S repeatedly to see various levels of detail
 +
* Press Shift-P to see the same on the console
  
Go back to the plugin directory, the new Makefile should have been generated. Type make to build.
+
==CalVR Application Development==
  
Now we need to modify the CalVR/config/config.xml to turn on the new plugin. We can search for ModelLoader and add the exact lines to config.xml, and modify the names to the new plugin's name. Now run CalVR, in the terminal we should see the init message of the new plugin.
+
Applications using the CalVR environment are developed in the form of [[CalVR Plugins]].

Latest revision as of 22:56, 3 July 2018

Contents

Overview

This wiki page was created to give programmers an overview of how to use IVL's virtual reality visualization framework CalVR. Special emphasis is given to those programmers who already know how to write code for COVISE.

If you just want to use CalVR, you can build it from source at this GitHub link.

What is CalVR?

CalVR is a virtual reality framework which has been entirely developed in the Immersive Visualization Laboratory at Calit2. It is designed to be open source and royalty free, for non-profit use. CalVR implements the typically used VR functionality of middleware such as CAVElib, COVISE, VRUI or FreeVR and adds to it by supporting nonstandard VR systems like autostereoscopic displays, as well as multi-user support for viewing and interaction. CalVR is entirely object oriented and written in C++. Functionality can be added through a simple plug-in system which allows compiling new modules separately from the main code. CalVR has built-in navigation algorithms, a 3D menu system, support for a variety of 3D display and tracking systems, as well as support for collaborative work at different sites. The campus wide visibility of Calit2’s Immersive Visualization Laboratory (IVL) has allowed the group to engage in a large variety of software application research and development with groups from many of UCSD’s departments. The experience from more than six years of campus-wide collaborations and many publications reporting on those projects both in the virtual reality community and also the domain sciences is flowing into the design and development of the CalVR software framework.

CalVR Specification and Features

  • Operating system:
    • Developed for CentOS Linux
    • Also builds for other Linux flavors, for instance SuSe
    • Mac OS X: experimental, not always tested
    • Windows: limited to single node
  • Programming language: C++
  • Graphics API: OpenSceneGraph (OSG)
    • Preferred 3D model file format: VRML, parsed by OSG's Coin3D library
  • Build system: CMake
  • XML configuration file for display layout, software parameters, plugin parameters
    • Supports Twinview, Xinerama, separate X displays
  • Tracking APIs supported: VRPN, TrackD, Omicron (UIC/EVL)
    • Multiple tracked heads and hands supported
    • Support for tracked head-mounted displays
    • Per-screen fixed cameras are possible
  • PC cluster support
    • Synchronization over Ethernet, 1+ Gbps preferred
    • Each cluster node runs a copy of CalVR
    • CalVR on cluster nodes run by remote ssh call from head node
    • Buffer swap synchronized over Ethernet
  • Support for multi-screen virtual reality systems
    • Stereo modes supported: all OSG supported modes (passive, quad-buffer, interlaced), 8-view autostereoscopic displays, mirrored displays
  • Support for sound effects through audio server
  • Support for collaborative sessions to link multiple VR systems over IP networks
  • Separation of core framework code and application development through plug-in system
    • Plug-ins are compiled independently of core code into shared object files
  • Coordinate system: z coordinate is up
  • Two GUI widget libraries supported, clean API for additional libraries
    • Functionality abstracted from GUI widget implementation

Building CalVR

The project is built with cmake. At the moment, it is set to require at least version 2.8.

Dependencies

The major external libraries needed are:
Latest stable release of OpenSceneGraph. These instructions have been updated for version 3.6.2.
Latest MiniXML

Optional Libraries that add additional features:
VRPN - Needed for vrpn tracking support - version 7.29 was that last I tested, though higher probably works.
Interleaver - A research library used to render lenticular screens - I will post a copy or add to source when I get permission.

Building OSG

Download OSG from the above link.
Go to main OSG directory and type ccmake .
In CMAKE_BUILD_TYPE, press Enter to edit the field, type in one of the options with debug information: RelWithDebInfo
On Mac OS X, set OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX to "imageio" and OSG_WINDOWING_SYSTEM to "Cocoa".
Press 'c' to configure, press 'g' to generate. and 'q' to quit. Now type make to build. Go get coffee.

OSG Extra Libraries

There are a number of extra libraries that are optional, but can be built into osg to add additional functionality. This is done by building/installing the libraries then setting the include/library path values in the osg ccmake window. When all paths are added, configure, generate the makefiles, and compile.

simage

Download simage 1.7.0: https://bitbucket.org/Coin3D/coin/downloads/simage-1.7.0.tar.gz

If you get the error message "../../simage-1.7.0/src/simage_png.c:326:7: error: dereferencing pointer to incomplete type" then patch simage_png.c by replacing "if (setjmp(png_ptr->jmpbuf)) {" with "if (setjmp(png_jmpbuf(png_ptr))) {".

If you want support for extra image types such as TIFF, JPEG, PNG, GIF or JPEG2000, we recommend the following package installs before running configure:

sudo yum install libtiff-devel
sudo yum install libjpeg-devel
sudo yum install libpng-devel
sudo yum install giflib-devel
sudo yum install jasper-devel
Coin3d

Download Coin 3.1.3: https://bitbucket.org/Coin3D/coin/downloads/Coin-3.1.3.tar.gz


This is a highly recommended library to add. It adds VRML support to OSG.
If you want the VRML models to have texture support, you need to build coin with the simage library: https://bitbucket.org/Coin3D/simage
After you have configured/built/installed simage, configure Coin with a line something like this:

configure --prefix=YOURINSTALLPATH --with-simage=YOURSIMAGEINSTALLHOME --disable-dl-simage

If all went well, the final configure settings output should contain:

simage linkage:  link-time binding

If you get the error message "error: ‘cc_debugerror_post’ was not declared in this scope" then include the header

#include <Inventor/C/errors/debugerror.h>

at the beginning (after the #define) of the file Coin-3.1.3/include/Inventor/SbBasic.h

If you get errors about abs functions, add the following define to the src/base/dict.h file before the first header include

#define __STRICT_ANSI__
#define __CORRECT_ISO_CPP_STDLIB_H_PROTO

If you get the error message "/usr/lib/libGL.so: could not read symbols: File in wrong format": fix it in libtool, or temporarily rename to wrong libGL.so so the linker can't find it.

To build osg with Coin3D, define the INVENTOR_INCLUDE_DIR to point to the coin include directory and the INVENTOR_LIBRARY_RELEASE to point to the coin library.

LibTIFF-4

ftp://ftp.remotesensing.org/pub/libtiff/ Most versions of linux have libtiff installed. The problem is that this is normally only version 3.X. There are some features of tiff version 4 that are useful and required for some things. It is recommended to build and compile against the latest tiff 4 version.
Note: in the cmake configuration tool, the tiff include/library variables are flagged as advance. You will need to hit 't' to turn on advanced mode and change the entries.

COLLADA

Download Collada 2.2 from the Collada server. Note that OSG 3.0.1 will not work with newer versions of Collada!

  • Fix a bug, when in main Collada directory: mv dom/include/1.4/dom/domasset.h dom/include/1.4/dom/domAsset.h
  • cp Makefile.linux Makefile
  • Only build minizip and dom: in Makefile comment out lines for fx, rt and viewer.
  • make
  • Copy include files to your include directory:
    • mkdir /share/calvr/extlibs/include/collada-dom2.2
    • cp -r /share/calvr/extlibs/src/collada-dom-2.2/dom/include/* /share/calvr/extlibs/include/collada-dom2.2
  • Copy library files to your lib directory:
    • cp /share/calvr/extlibs/src/collada-dom-2.2/dom/build/linux-1.4/libcollada* /share/calvr/extlibs/lib
  • Add to .bashrc: export COLLADA_DIR=<prefix-dir>. <prefix-dir> is what you would normally put as --prefix= when configuring. Example: /share/calvr/extlibs
  • Run OSG's ccmake .
  • Make sure at least all COLLADA lines without DEBUG in them are filled out correctly.

Getting the Code

The CalVR repository is split into two sections, one of the framework and another for the plugins.

GitHub

There are two ways to check out the CalVR source code from the GitHub repository: read-only and developer mode. Programmers who want to write CalVR plugins, but don't intend to modify the core should read-only checkout the core, and use the developer checkout method for the plugins.

Read-Only Checkout

You can do a read only checkout by doing the following:

git clone git://github.com/CalVR/calvr.git CalVR
git clone git://github.com/CalVR/calvr_plugins.git CVRPlugins

Developer Checkout

Developers at IVL who do not need to modify the core of CalVR should use the shared CalVR sources under /home/calvr/CalVR, and should check out the plugin sources from the GitHub repository into their home directories. Plugin developers outside of IVL should check out the read-only version of the core, and the developer version of the plugin code.

To check out code as a developer you first need to get permission from one of the CalVR administrators (Andrew Prudhomme, Philip Weber, Jurgen Schulze). Then you need to create a GitHub account. Send your account name to an administrator to be added to the developer list.

Then, to pull down the CalVR plugin code from GitHub you need to do the following in your home directory (replace "username" with your GitHub name):

git clone https://username@github.com/CalVR/calvr_plugins.git CVRPlugins

If you're also working on the CalVR core code, pull it down like this:

git clone https://username@github.com/CalVR/calvr.git CalVR

Building Core for Linux

To help aid the cmake configure, you can optionally set environment variables for the location of these libraries:
OSG_HOME - location of OpenSceneGraph install, very good to set if cglx has a copy of osg in /usr/local
MXML_HOME - location of MiniXML install

Go to the project root and run

ccmake .

then type 'c' to configure.

If the configure doesn't find the core libraries, manually fill in the information. For OpenSceneGraph, fill in the OSG_HOME value and reconfigure. This should fill in the OSG_INCLUDE_DIR correctly. Note that this process also sets the library locations in hidden variables, so you can't just fill in the include directory manually.

There are also optional libraries that add additional fuctionality.
Interleaver - if present, builds the ability to create a screen for lenticular 3D rendering - TODO: upload src here

From the ccmake menu you can also select which plugins you want to build. Turn those plugins on and reconfigure. The configure will tell you if there are undetected additional libraries needed to build those plugins and the cmake variables for those libraries will now be in the main menu.

When you are done, select the option to generate and exit ccmake.

From here, run make.

Building Plugins

The plugins are built in a similar way. Go the the plugin root directory and run

ccmake .

The plugins also need OpenSceneGraph and this can be set the same way as above. The plugins need to know where the CalVR home directory is. This can either be manually set or it will look for the CALVR_HOME environment variable.

You can then toggle the plugins that you want to build on and reconfigure. If there plugins have any dependencies, they will appear in the cmake config.
Now generate and run make.
Note: Different plugins have there own library and data dependencies. See Plugin Configuration.

Building Core for Windows

The instructions for the Windows build are on a separate page.

CalVR Configuration

Environment

Before runing CalVR you need to add the library directories into your LD_LIBRARY_PATH in .cshrc/.bashrc. On Mac OS X, set DYLD_LIBRARY_PATH.
These directories should include the ${CALVR_HOME}/lib directory and any lib directories for the CalVR dependencies (i.e. osg/mxml/etc)

Add an environment variable to .cshrc/.bashrc, for example:
.cshrc

setenv CALVR_HOME /home/calvr/CalVR/
setenv CALVR_CONFIG_FILE config.xml

.bashrc

export CALVR_HOME=/home/calvr/CalVR/
export CALVR_CONFIG_FILE=config.xml

Config File

Calvr uses an xml based configuration file.
For more infomation on the config file, see: CalVR Config File

Running CalVR

The main CalVR executable is ${CALVR_HOME}/bin/CalVR.

Show rendering statistics:

  • Click on main rendering window on head node
  • Press Shift-S repeatedly to see various levels of detail
  • Press Shift-P to see the same on the console

CalVR Application Development

Applications using the CalVR environment are developed in the form of CalVR Plugins.