FreeVR Library Programming Tutorial (w/ OpenGL)

The FreeVR Library will be used to exemplify many VR interface and programming techniques. FreeVR will work in most local VR facilities (eg. CAVE™ or Head-Based-Display), as well as on the available desktop machines in a simulated-VR mode. It can be used on PC's with Linux and OpenGL installed, or in a (currently very) limited way on PC's with Cygwin installed.

The FreeVR webpage is www.freevr.org.

This tutorial takes the approach of starting with an extremely simple initial example and then advancing in very small increments (baby steps) until we can perform some interesting tasks in virtual reality. Another point to make about this tutorial is that it is not intended as a means to learn advanced OpenGL programing. The computer graphics in these examples are all very simple. The goal of the tutorial is to highlight programming tasks that are unique to programming for a virtual reality system.

On the other hand, some basic OpenGL techniques can be learned by following this tutorial, as it will show how to handle texture maps, billboards, cutting planes, and moveable lights.

Other tutorials are under development for interfacing FreeVR to additional rendering and world simulation systems. Presently there is a tutorial available for the SGI Performer scene-graph library, but as Performer has greatly decreased in usage new tutorials will cover similar, but more popular libraries.

This tutorial has been most recently tested with FreeVR version 0.6a.


Part 2: Examples 6 - 11

Now that we know the basics about creating simple VR experiences, and have done the mildly interesting task of moving an object about through physical inputs, we will continue the tutorial of OpenGL FreeVR programs by introducing how to let participants manipulate objects in the virtual world through the "direct manipulation" method of control. We will also look at providing a means of communicating to the user through very simple text output, and we will begin to explore the use of the FreeVR locking mechanism to ensure the safty of the world database.

Each example links to a copy of the source code (and the difference from the previous example) . The examples can be compiled with one or more of the following additional files:



Example 6: Very simple output — 2D text (ex6)

Text rendering is often useful as part of the user interface, or for debugging applications. This example introduces a very basic way of adding text into the rendering of the virtual world. It is not the best method for most circumstances, but will serve to get us started.

                  


Example 7: A virtual pointer & Coordinate Systems (ex7)

                  
 


Example 8: Objects with behavior & using vectors (ex8)

Objects that move on their own can make for a more interesting virtual world. In this example, we use the direction the wand is pointing (a 6sensor input) to affect the direction of a small projectile.



Example 9: Object Selection (ex9)

 


Example 10: Manipulating the world (ex10)

 


Example 11: Using Locks to Safeguard the Code (ex11)





Last modified 10 January 2010.
Bill Sherman, shermanw@indiana.edu

© Copyright William R. Sherman, 2010.
All rights reserved. In particular, republishing any files associated with this tutorial in whole or in part, in any form (included electronic forms) is prohibited without written consent of the copyright holder. Porting to other rendering systems is also prohibited without written consent of the copyright holder.