FreeVR Library programming in SGI Performer



The Performer FreeVR Library -- an interface of a full-feature rendering system for VR

Features of Performer

Online documentation

The FreeVR library still:



Basic structure of a Performer FreeVR Library application

The Performer and FreeVR Libraries run many tasks in parallel. The forking of the render processes is handled by Performer instead of the FreeVR library. Performer also has other duties that it distributes into separate processes:

Performer library processes:

NOTE: unlike the OpenGL version of the FreeVR library, Performer synchronizes between the application-simulation process and the render process.

FreeVR library processes:

Display callbacks are no longer handled through the FreeVR library interface.



Example 0: The simple pure-Performer application (pfex0)



Example 1: The bare necessities FreeVR-Performer application



Example 2: A (civilized, but) basic pf-FreeVR application (pfex2)



Example 3: A world with some action (pfex3)

Adds the familiar movement to two of the objects in the scene.



Example 4: Rendering objects in alternate coordinate systems (pfex4)

                  



Example 5: Object Selection (pfex5)

Highlights the object touched by the wand.



Example 6: Manipulating the world (pfex6)

Allows an object to be grabbed and moved with the left button.
NOTE: quirk in object selection always jumps to highest numbered object in range.



Example 7: Traveling through the world (pfex7)

                  

Uses a Performer application-traversal callback to handle travel input.



Example 8: Using traversal callbacks to handle behaviour and interactions (pfex8)

  • The Performer Library provides useful functions:
  • Traversal callbacks can be executed in any specific Performer process:

  • Example 8 (pfex8_callback.c++) uses a traversal callback function.



    Example 9: Rendering a miniature world (WIM) (pfex9)

                      

    Example 9 adds a world-in-minature representation when the middle button is pressed. Mini-world is attached to the secondwand.

    Also shows how to render 3D text in the world.

  • The Performer Library provides useful functions:

  • Example 9 (pfex9_wim.c++) demonstrations a world-in-miniature display.

    In order to use the 2nd wand in FreeVR, a small addition will need to be added to you FreeVR configuration file:

    inputdevice "simulator-indev" += {
            input "sensor6[hand2]" = "sensor6(sim[2])";
            control "setsensor(2)" = "switch2(keyboard:key[g])";
    }
    



    Example 10: Intersection testing (pfex10)

    Sends a ray out from the wand and highlights the object it is pointing at. A sphere indicates the point of contact, and some text informs us when we aren't pointing at anything.

  • The Performer Library provides useful functions:

  • Example 10 (pfex10_isect.c++) demonstrations intersection testing in Performer.



    Example 11: Scenegraph debugging (pfex11)

    Having the world contained in a scenegraph can sometimes make it more difficult to debug an application. Thus, having a means to visualize the scenegraph is important. In this example application, we introduce a source file that enables the user to view the scenegraph in text form, displayed on a separate terminal.

    This example uses the some of the function keys to manipulate control of the scenegraph textual view:

    NOTE: In FreeVR, keypresses are (currently) treated as separate 2-switch button presses. So the configuration file needs to have all the interaction keys added as button inputs. To do so, add the following to your ~/.freevrrc file:

    inputdevice "simulator-indev" += {
            input "switch2[F1]" = "switch2(keyboard:key[F1])";      # 4
            input "switch2[F2]" = "switch2(keyboard:key[F2])";      # 5
            input "switch2[F3]" = "switch2(keyboard:key[F3])";      # 6
            input "switch2[F4]" = "switch2(keyboard:key[F4])";      # 7
            input "switch2[F5]" = "switch2(keyboard:key[F5])";      # 8
            input "switch2[F6]" = "switch2(keyboard:key[F6])";      # 9
            input "switch2[F7]" = "switch2(keyboard:key[F7])";      # 10
            input "switch2[F8]" = "switch2(keyboard:key[F8])";      # 11
            input "switch2[F9]" = "switch2(keyboard:key[F9])";      # 12
            input "switch2[F10]" = "switch2(keyboard:key[F10])";    # 13
            input "switch2[F11]" = "switch2(keyboard:key[F11])";    # 14
            input "switch2[F12]" = "switch2(keyboard:key[F12])";    # 15
            input "switch2[HOME]" = "switch2(keyboard:key[HOME])";  # 16
            input "switch2[END]" = "switch2(keyboard:key[END])";    # 17
            input "switch2[PRINTSCREEN]" = "switch2(keyboard:key[PAUSE])";  # 18
            input "switch2[EQUAL]" = "switch2(keyboard:key[EQUAL])";        # 19
            input "switch2[MINUS]" = "switch2(keyboard:key[MINUS])";        # 20
            input "switch2[PLUS]" = "switch2(keyboard:key[PLUS])";          # 21
            input "switch2[PAGEUP]" = "switch2(keyboard:key[PAGE_UP])";     # 22
            input "switch2[PAGEDOWN]" = "switch2(keyboard:key[PAGE_DOWN])"; # 23
            input "switch2[BACKSPACE]" = "switch2(keyboard:key[BACKSPACE])";# 24
            input "switch2[ACCENTGRAVE]" = "switch2(keyboard:key[GRAVE])";  # 25
    }
    


    Example 12: Creating geometries by hand (pfex12)

    Example 12 gives an example of how to create a pfGeoSet and pfGeode through code (rather than existing Performer library calls).

    In this case, we create a cube of dimensions +/-1 in X,Y & Z -- ie. twice as big in each dimension as the standard Performer cube object.

  • Example 12 (pfex12_geode.c++) demonstrations how to build a pfGeoSet/pfGeode by hand.
    
    
    
    
    


    Example 13: Adding texture maps to a pfGeoSet/pfGeode (pfex13)

    Example 13 gives an example of how to create and assign a texture map for a pfGeoSet and pfGeode through code (rather than existing Performer library calls).

    In this case, we reuse the cube of dimensions +/-1 in X,Y & Z from pfex12.

  • Example 13 (pfex13_texture.c++) demonstrations how to add a texture to a pfGeoSet/pfGeode by hand.
    
    
    
    
    
    
    
    
    
    
    
    


    Last modified 28 October 2003.
    Bill Sherman, wsherman@ncsa.uiuc.edu

    This tutorial code, images and documentation are Copyright © William R. Sherman, 2004.
    All rights reserved.