Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members
RICDemo Source Documentation
- Author:
-
Chris Scharver, scharver@evl.uic.edu
- Date:
-
May 2003
This demonstration code illustrates some of the coding mechanisms used for integrating the CAVELib and GHOST libraries for use on the Personal Augmented Reality Immersive System (PARIS). The application creates a ball object represented simultaneously in Open Inventor and GHOST scene graphs. Changes in one scene graph must be reflected in the other. Management of these changes is the key component of creating a believable interface within the virtual environment. A smaller ball represents the PHANToM position within the environment. The PHANToM may be used to touch and drag the larger ball throughout the visible workspace. A green wireframe box outlines the available workspace based on values returned from the GHOST API.
Execution view of RICDemo
The code uses several classes developed separately. The Observer Pattern is used for handling notification between separate objects. Also, my OIVAppShell code binds the CAVELib with the Inventor scene graph. There are only a few classes in this system, and the diagram below provides a simple overview of how those classes interact with each other:
UML Class Overview
It is important to understand the structure of the Inventor scene graph since the offset transform must be specially placed in order for the GHOST graphics to properly appear in the virtual environment.
Inventor Scene Graph
The scene graph structure is pretty basic. A root separator node is used for the scene. A light source illuminates the scene. Because GHOST works in millimeters, a Units node sets the proper units for the graphics system. The next node is a Transform node storing the offset from the CAVE origin to the PHANToM device workspace origin. Another separator contains the PHANToM's graphic representation. A similar separator is used to store the RICBall with its Transform, Material, and Sphere nodes.
The configuration of the environment is handled through the use of CMake. With the ability to locate separate libraries and paths, CMake makes it very easy to move a project between different platforms. It will generate Makefiles for unix systems and Visual Studio workspaces on Windows. The use of CMake may appear as an extra step, but it provides the flexibility for easily moving between platforms.
CMake can build a project in a different directory than the source code. This capability is useful for keeping source and object files separate. I usually create a 'build' directory within the source code and set CMake to build the project there.
CMake reads the file CMakeLists.txt in the source directory, and that file is used to configure and build the project. This file contains a list of the files and libraries that CMake must find. CMake ships with several modules for finding libraries, but none of them support the libraries used in this project. For this reason, I have written several very simple modules to handle locating required libraries:
- FindCAVELib.cmake
- FindGHOST.cmake
- FindInventor.cmake
- FindOpenGL.cmake
These modules will locate the include paths as well as the binary library files. If any are not found, CMake provides a GUI that may be used to manually locate or change the settings. This ability is especially useful with the Inventor module, as a system may have both TGS Inventor and Coin3D installed. The GUI may be used to locate the appropriate library to use.
Running CMakeSetup.exe (Windows) or cmake (unix) will present a GUI. The available settings are displayed, although additional options are available by toggling the Advanced checkbox. Pressing the Configure button will execute the configuration to locate all relevant settings. Once configuration is complete, press Ok to generate the Visual Studio workspace file.
The Visual Studio files (or Makefiles) will be placed in the build directory specified by the user. The .dsw file can be opened to work with the project. CMake creates a BUILD_ALL project that fill the role of the Batch Build command within Visual Studio. It's more convenient than checking multiple project check boxes. To make debugging easier, select RICDemo and choose 'Set Active Project.'
When it comes time to add files to the project, the proper and portable approach is to create new entries in the CMakeLists.txt file and regenerate the Visual Studio project. Taking these extra steps will make certain that the build process remains portable across multiple system configurations.
The source code is available as a zipped archive. The archive contains all the files but without the CVS directories. Everything should build properly, but contact me if something goes wrong.
Generated on Thu Jun 12 10:13:13 2003 for RICDemo by
1.2.18