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 4: Examples 16 - 21

Now that we have had some experience with the beginnings of interesting interaction, we will continue the tutorial by expanding the use of OpenGL rendering capabilities, and then look at the world-in-miniature.

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 16: 3D text in the world (ex16)



Example 17: Objects with textured surfaces (ex17)

Objects with textured surfaces, make for a more interesting looking virtual world.

Example 18: Objects with billboarded textured surfaces (ex18)

A common technique in computer graphics to simplify rendering (and thus reduce rendering time), is to use a textured plane that rotates to continually face the viewer — known as a "billboard". Common examples include trees and spheres.

Example 19: The world in miniature (ex19)

The World-in-Miniature (WIM) technique is a common virtual world interface tool.

Example 20: Clipping away part of the world (ex20)

Using standard OpenGL clipping routines, we can provide a means for the user to see-through part of the world.

Example 21: Using OpenGL lighting for interactive lights (ex21)

In addition to manipulating objects in the world, sometimes it is valuable to manipulation other features of the world, such as the lighting parameters. In this case, giving us the effect of holding a flashlight.

Tutorial Summary:

This tutorial demonstrates most of the important and unique features of the FreeVR virtual reality integration library. Each function is introduced as part of a small progression toward increasinly more capable demonstration applications. The functions that are not presented here tend to be very similar to ones that are presented, plus many of the mathematical operations which do not need to be fully enumerated.

The FreeVR webpage includes a functions reference document that fully lists all the functions needed for robust application development.

Other tutorials are also under development to demonstrate the use of FreeVR with scene-graph and physics libraries. These will become available on the FreeVR tutorials webpage as they reach sufficiently documented states. There is also a FreeVR-Performer tutorial available on the webpage, though that is of limited value since the Performer library is not as widely used as it has been in the past.

Programming Caveats to Remember:

As a reminder, there are a handful of things to watch our for when writing virtual reality applications:







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.