VR Juggler

The Programmer's Guide

Version 2.0 Alpha 4

$Date: 2004/03/07 14:53:50 $


Table of Contents

I. Introduction
1. Getting Started
Necessary Experience
Required Background
Other VR Software Tools
Organization
2. Application Basics
Application Object Overview
No main()—Don't call me, I'll call you
Application Objects Derive from Base Classes for Specific Graphics APIs
Writing an Application Means Filling in the Blanks
Benefits of Application Objects
Allow for Run-Time Changes
Low Coupling
Allows Implementation Changes
Multi-Language Interaction
VR Juggler Startup
No main()—Sort Of
Structure of a main() Function
Kernel Loop
Definition of a Frame
Base Application Object Interface
Initialization
Frame Functions
Draw Manager-Specific Application Classes
OpenGL Application Class
OpenGL Performer Application Class
3. Helper Classes
The gmtl::Vec<S, T> Helper Class
High-Level Description
Using gmtl::Vec3f and gmtl::Vec4f
Creating Vectors and Setting Their Values
Inversion (Finding the Negative of a Vector)
Normalization
Length Calculation
Multiplication by a Scalar
Division by a Scalar
Converting to an OpenGL Performer Vector
Assignment
Equality/Inequality Comparison
Dot Product
Cross Product
Addition
Subtraction
Full Transformation by a Matrix
The Gory Details
The gmtl::Matrix44f Helper Class
High-Level Description
Using gmtl::Matrix44f
Creating Matrices and Setting Their Values
Assignment
Equality/Inequality Comparison
Transposing
Finding the Inverse
Addition
Subtraction
Multiplication
Scaling by a Scalar Value
Making an Identity Matrix Quickly
Zeroing a Matrix in a Single Step
Making an XYZ, a ZYX, or a ZXY Euler Rotation Matrix
Making a Translation Transformation Matrix
Making a Scale Transformation Matrix
Extracting Specific Transformation Information
Converting to an OpenGL Performer Matrix
The Gory Details
The gadget::DeviceInterface<T> Helper Class
High-Level Description
Using gadget::DeviceInterface<T>
The Gory Details
The gadget::Proxy Helper Class
High-Level Description
Using gadget::Proxy
The Gory Details
II. Application Programming
4. Writing Applications
Application Review
Basic Application Information
Draw Manager-Specific Application Classes
Getting Input
How to Get Input
Where to Get Input
Tutorial: Getting Input
OpenGL Applications
Clearing the Color and Depth Buffers
OpenGL Drawing: vrj::GlApp::draw()
Tutorial: Drawing a Cube with OpenGL
Context-Specific Data
Using Context-Specific Data
Context-Specific Data Details
Tutorial: Drawing a Cube using OpenGL Display Lists
OpenGL Performer Applications
Scene Graph Initialization: vrj::PfApp::initScene()
Scene Graph Access: vrj::PfApp::getScene()
Tutorial: Loading a Model with OpenGL Performer
Other vrj::PfApp Methods
OpenSG Applications
Scene Graph Initialization: vrj::OpenSGApp::initScene()
Scene Graph Access: vrj::OpenSGApp::getSceneRoot()
Tutorial: Loading a Model with OpenSG
VTK Applications
5. Porting to VR Juggler from the CAVElib
The Initialize, Draw, and Frame Routines
In CAVElib
In VR Juggler
Getting Input from Devices
In CAVElib
In VR Juggler
Configuration
In CAVElib
In VR Juggler
Important Notes
Shared Memory
OpenGL Context-Specific Data
Source Code
The Form of a Basic CAVElib Program
The Form of a Basic VR Juggler Program
6. Porting to VR Juggler from GLUT
Window Creation and Management
The Initialize, Draw, and Frame Routines
In GLUT
In VR Juggler
Getting Input from Devices
In GLUT
In VR Juggler
Configuration
In GLUT
In VR Juggler
Important Notes
Shared Memory
OpenGL Context-Specific Data
Source Code
The Form of a Basic GLUT Program
The Form of a Basic VR Juggler Program
III. Advanced Topics
7. System Interaction
8. Multi-threading
Techniques
Tutorial: Perform Computations Asynchronously to Rendering with intraFrame()
Class Declaration and Data Members
The preFrame() Member Function
The draw() Member Function
Exercise
Helper Classes
vpr::Thread
vpr::BaseThreadFunctor
Using the vpr::Semaphore Interface
Using the vpr::Mutex Interface
Using Data Buffering
Triple Buffering
Optimizing Triple Buffering
Using Triple Buffering in an Application
Tutorial: Perform Computations Using Triple Buffering
9. Run-Time Reconfiguration
How Run-Time Reconfiguration Works
Reasons to Use Run-Time Reconfiguration
Using Run-Time Reconfiguration in an Application
Create Application-Specific Configuration Definitions
Implement the Dynamic Reconfiguration Interface
Procesing Configuration Elements
Loading and Saving Configurations
Tutorial: Using Application-Specific Configurations
Class Declaration
Application Configuration
The configCanHandle() Member Function
The configAdd() Member Function
The draw() Member Function
Exercise
10. Extending VR Juggler
Device Drivers
Custom Simulators
Simulator Components
Glossary of Terms
Index

List of Figures

2.1. vrj::App hierarchy
2.2. Kernel loop sequence
2.3. Application object interface
2.4. vrj::GlApp interface extensions to vrj::App
2.5. vrj::PfApp interface extensions to vrj::App
4.1. VR Juggler kernel control loop
4.2. vrj::GlApp application class
4.3. VR Juggler OpenGL system
4.4. vrj::PfApp application class
4.5. vrj::OpenSGApp application class

List of Tables

3.1. Row-major access indices
3.2. Column-major access indices
4.1. Tutorial Overview
4.2. Tutorial Overview
4.3. Tutorial Overview
4.4. Tutorial Overview
4.5. Tutorial Overview
8.1. Tutorial Overview
9.1. Tutorial Overview

List of Examples

4.1. Initializing context-specific data
9.1. Complete listing of config_app.jdef
9.2. ConfigApp.jconf