VR Juggler

The Programmer's Guide

Version 1.0.6

$Date: 2002/09/24 17:31:36 $


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
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 vjVec3 and vjVec4 Helper Classes
High-Level Description
Using vjVec3 and vjVec4
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 (vjVec3 only)
Addition
Subtraction
Full Transformation by a Matrix
Partial Transformation by a Matrix
The Gory Details
The vjMatrix Helper Class
High-Level Description
Using vjMatrix
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
Constraining Rotation About a Specific Axis or Axes
Making a Matrix Using Direction Cosines
Making a Matrix from a Quaternion
Making a Rotation Transformation Matrix About a Single Axis
Making a Translation Transformation Matrix
Making a Scale Transformation Matrix
Extracting Specific Transformation Information
Converting to an OpenGL Performer Matrix
The Gory Details
The vjDeviceInterface Helper Class
High-Level Description
Using vjDeviceInterface
The Gory Details
The vjProxy Helper Class
High-Level Description
Using vjProxy
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
OpenGL Drawing: vjGlApp::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: vjPfApp::initScene()
Scene Graph Access: vjPfApp::getScene()
Tutorial: Loading a Model with OpenGL Performer
Other vjPfApp Methods
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
Helper Classes
Using the vjThread Interface
Using the vjBaseThreadFunctor Interface
Using the vjSemaphore Interface
Using the vjMutex Interface
9. Run-Time Reconfiguration
How Run-Time Reconfiguration Works
Reasons to Use Run-Time Reconfiguration
Using Run-Time Reconfiguration in an Application
Application Tutorial
10. Adding Device Drivers to VR Juggler
In-Depth Driver Guide
Implementing the Device Driver
Register the Device Driver with VR Juggler
Device Driver Configuration
Configuration Files
Writing Code that Accepts the Configuration
Example Code
Index

List of Figures

2.1. vjApp hierarchy
2.2. Kernel loop sequence
2.3. Application object interface
2.4. vjGlApp interface extensions to vjApp
2.5. vjPfApp interface extensions to vjApp
4.1. VR Juggler kernel control loop
4.2. vjGlApp application class
4.3. VR Juggler OpenGL system
4.4. vjPfApp 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

List of Examples

4.1. Initializing context-specific data