Building Virtual Environments that are Reconfigurable, Scalable, Extensible with DIVERSE

The DIVERSE Course
May 16, 2002

Lance Arsenault, John Kelso

             

Abstract

This class will teach you how to construct Device Independent Virtual Environments- Reconfigurable, Scalable, Extensible (DIVERSE) applications. DIVERSE is comprised of two C++ application progamming interfaces that provide tools to write Performer based applications which can be run on a CAVETM, ImmersaDeskTM, HMD (head mounted displays), desktop and laptop without modification of the applications code.

Prerequisites


  1. Day 1: section 1: 8:30am-10:15am
    Brief Description and Razzle Dazzle-Demos

    Objective:
    Describe and demonstrate what DIVERSE can do, without details; hopefully motivates to learn

    1. Very brief description of DIVERSE

      • free open-source
      • very modular, reconfigurable, extensible
      • DTK
        • non-graphics, including network services, hardware interfaces
      • DPF
        • device independent graphics built using Performer

    2. Performer-town on Desktop

      show desktop navigation- the default- show heads-up, navigation control

      % cd /usr/share/Performer/data/town/
      % diversifly \
         --origin 2567.215576 2392.712891 2 -92.218323 0.0 0.0 \
         --length 0.9 town_ogl_pfi.pfb

      show simulator navigation and features: toggle objects, jump view

      % export DPF_DSO_FILES=desktopCaveSimGroup
      % diversifly \
         --origin 2567.215576 2392.712891 2 -92.218323 0.0 0.0 \
         --length 0.9 town_ogl_pfi.pfb

      add collision detection and terrain following

      % export DPF_DSO_FILES=desktopCaveSimGroup:collisionDetection
      % dtk-floatSliders walk -n 1 -s 0 0.001 10.001 1 -l Height &
      % diversifly \
         --origin 2567.215576 2392.712891 2 -92.218323 0.0 0.0 \
         --length 0.9 town_ogl_pfi.pfb

    3. Shiny cow on Desktop

      back to the defaults

      % unset DPF_DSO_FILES
      % cd /usr/share/Performer/data/
      % diversifly --length .25 --origin 2 0 16 0 -90 0 shinycow.obj

      add a flashlight- can't use default any more

      % export DPF_DSO_FILES=desktopCaveSimGroup:wandLight
      % diversifly --nolights --length .25 --origin 2 0 16 0 -90 0 shinycow.obj

      record navigation

      % export DPF_DSO_FILES=desktopCaveSimGroup:wandLight:playbackWrite
      % diversifly --length .25 --origin 2 0 16 0 -90 0 shinycow.obj

      playback navigation

      % export DPF_DSO_FILES=desktopCaveSimGroup:wandLight:playbackRead
      % diversifly --length .25 --origin 2 0 16 0 -90 0 shinycow.obj

    4. Performer-town in CAVE

      use the VT CAVE with wand/joystick navigation

      % cd /usr/share/Performer/data/town/

      % export DPF_DSO_FILES=vtCaveGroup
      % diversifly \
         --origin 2567.215576 2392.712891 2 -92.218323 0.0 0.0 \
         --length 0.9 town_ogl_pfi.pfb

      add collision detection and terrain following

      % export DPF_DSO_FILES=vtCaveGroup:collisionDetection
      % dtk-floatSliders walk -n 1 -s 0 0.001 10.001 1 -l Height &
      % diversifly \
         --origin 2567.215576 2392.712891 2 -92.218323 0.0 0.0 \
         --length 0.9 town_ogl_pfi.pfb

    5. Shiny cow in CAVE

      back to defaults in CAVE

      % unset DPF_DSO_FILES
      % cd /usr/share/Performer/data/
      % export DPF_DSO_FILES=vtCaveGroup
      % diversifly --length .25 --origin 2 0 16 0 -90 0 shinycow.obj

      add a flashlight

      % export DPF_DSO_FILES=vtCaveGroup:wandLight
      % diversifly --length .25 --origin 2 0 16 0 -90 0 shinycow.obj

      record navigation

      % export DPF_DSO_FILES=vtCaveGroup:wandLight:playbackWrite
      % diversifly --length .25 --origin 2 0 16 0 -90 0 shinycow.obj

      playback navigation

      % export DPF_DSO_FILES=vtCaveGroup:wandLight:playbackRead
      % diversifly --length .25 --origin 2 0 16 0 -90 0 shinycow.obj

    6. Using DTK shared memory to mix things up

      use sliders to put data into memory

      % cd `dpf-config --source`/examples/shMDyn/diffEq0/
      % dtk-floatSliders -n 6 position -s 1 0.5 3 0.95 -s 3 -180 180 0 \
         -s 4 -180 180 0 -s 5 -180 180 0 -l x y z h p r &

      read the data, queued

      % xterm -e dtk-readFloats position --queue &

      run a program that uses the data to position an object

      % ./render &

      use the sliders to look at the data

      press the "update continuous" button in the slider window

      look at the data with a virtual oscilloscope

      % dtk-floatScope position -s position 1 -1 3 -s position 2 -1 3 -s position 3 -180 180 \
         -s position 4 -180 180 -s position 5 -180 180 &

      run a program that writes data into memory, calulated real-time

      % ./diffEq

      run a program that writes data into memory from a file

      % cd `dpf-config --source`/examples/shMDyn/playback/
      % ./playback playdata

    7. Using DTK remote shared memory

      transparently networked- instructor's machine sends out CAVE and navigation data

      % cd /usr/share/Performer/data/town/
      % export DPF_DSO_FILES=desktopCaveSimGroup:navDTKOutput:caveDTKOutput
      % diversifly --origin +2567.215 +2392.712 +2.00000 -92.2 +000 +000 \
         --length 0.9 town_ogl_pfi.pfb &

      % DPF_DSO_FILES=caveSimDisplay:xkeyboardInput:caveSim
      % DPF_DSO_FILES=$DPF_DSO_FILES:caveDTKInput:dtkNav:setHeadView
      % export DPF_DSO_FILES=$DPF_DSO_FILES:toggleObjectsGroup:debugHeadsUp
      % diversifly --origin +2567.215 +2392.712 +2.00000 -92.2 +000 +000 \
         --length 0.9 town_ogl_pfi.pfb &

      % dtk-floatScope head -s head 3 -180 180 -s head 4 -180 180 -s head 5 -180 180 &

      % dtk-floatSliders head -s 3 -180 180 0 -s 4 -180 180 0 -s 5 -180 180 0 -l x y z h p r &

      % dtk-gnomonDisplay head &

      network with shared memory

      % dtk-server -d

      % /sbin/ifconfig | grep Bcast

      % dtk-connectRemoteSharedMem head IP_ADDRESS &

      % dtk-shutdownServer

  2. Day 1: section 2: 10:30-noon
    Running Command line programs

    Objective:
    Be able to use DIVERSE without programming

    1. diversifly

      load Performertown data, knowing nothing about it

      % cd /usr/share/Performer/data/town/
      % diversifly --center town_ogl_pfi.pfb

      turn on the heads-up display

      press "?" with the mouse in the graphics window

      navigate down to the ground and find a place you like

      press "+" and "-" to double or half speed
      use the left mouse button to go forward/back
      use the middle mouse button to raise/lower

      record this place as a new origin

      press ">" to dump your position to standard output
      "cut" the XYZHPR of the POSITION line
      press "Esc" to exit

      paste this into a new diversifly command

      % diversifly --origin +2567.215 +2392.712 +2.00000 -92.2 +000 +000 \
         town_ogl_pfi.pfb

      run it in the simulator

      % export DPF_DSO_FILES=desktopCaveSimGroup
      % diversifly --origin +2567.215 +2392.712 +2.00000 -92.2 +000 +000 \
         town_ogl_pfi.pfb

      use the 10' simulator cube to size the units

      press and hold "s" then press "c" twice and release "s"
      press space and move mouse to fly around- how's it look?

      the world seems a bit too big- change its size

      press and hold "s" then press "c" twice and release "s"
      press space and move mouse to fly around- how's it look?

      make one model unit be 0.9 meters

      % diversifly --origin +2567.215 +2392.712 +2.00000 -92.2 +000 +000 \
         --length 0.9 town_ogl_pfi.pfb

      try another- the shiny cow

      % unset DPF_DSO_FILES
      % cd /usr/share/Performer/data/
      % dpf-transform --center --bound shinycow.obj /tmp/foo.pfb
      % cd /tmp/
      % diversifly --origin 0 -20 0 0 0 0 foo.pfb
      % dpf-transform --euler 0 90 0 foo.pfb bar.pfb
      % export DPF_DSO_FILES=desktopGroup:centerSwitchPivotNavMod:toggleBoundingSphere
      % diversifly --origin 0 -20 0 0 0 0 bar.pfb
      press "B" to see bounding sphere
      press "?" for the heads-up and "p" to switch to trackballNav
      use middle button to spin!
      % export DPF_DSO_FILES=desktopCaveSimGroup:wandLight
      % diversifly --nolights --origin 0 -5 0 0 0 0 bar.pfb
      press "w" to see the wand, and press "Alt" and move the mouse

      DTK commands

      % dtk-<TAB><TAB>
      % dtk-server --help
      % dtk-connectRemoteSharedMem --help
      % dtk-loadService --help
      % dtk-pingServer
      % dtk-server
      % dtk-pingServer
      % dtk-loadService hello
      % dtk-readStrings hello -q
      % dtk-unloadService hello
      % dtk-shutdownServer
      % dtk-destroySharedMem

  3. Day 1: section 3: 1:15-2:45
    DIVERSE API and programming using examples

    Objective:
    Understand, move, modify, make DIVERSE programs based on examples

    1. dpf-config, dtk-config and portable Makefiles and scripts

      % dpf-config
      % dpf-config --libs
      % dpf-config --source
      % cd `dpf-config --source`/examples/
      % cd minimumHelloWorld
      % cat Makefile
      % cd ..; mkdir /tmp/hello
      % cp minimumHelloWorld/* /tmp/hello
      % cd /tmp/hello
      % make
      % ./hello

    2. display

      describe scenegraph
      describe display class diagram
      % cd `dpf-config --source`/contrib_DSOs/
      % less vtCaveDisplay.C
      % cd /tmp/hello
      % export DPF_DSO_FILES=hyperDisplay:xkeyboardMouseInput:toggleObjectsGroup:trackballNav
      % ./hello

    3. two versions of hello.C

      % cd `dpf-config --source`/examples/minimumHelloWorld
      % cat hello.C
      % cd ../helloWorld/
      % less hello.C

    4. a DPF DSO that writes navigational data

      % cd `dpf-config --source`/DSOs
      % less navDTKOutput.C

    5. there is a similar DSO that reads navigational data

      % cd `dpf-config --source`/DSOs
      % less dtkNav.C

    6. run writer and reader

      % export DPF_DSO_FILES=desktopGroup:navDTKOutput
      % diversifly sub.pfb gnomon.pfb &

      % export DPF_DSO_FILES=desktopGroup:dtkNav
      % diversifly sub.pfb gnomon.pfb &

    7. input

      explain 2 tiered architecture, 6 logical input types

      example: mouse pointer- polled, queued, as reader specifies

      % cd `dpf-config --source`/examples/mouse
      % less pollPointer.C
      % diff pollPointer.C queuePointer.C
      % ./pollPointer
      % ./queuePointer

  4. Day 1: section 4: 3:00-4:30
    New features, Open lab
    1. DGL, the DIVERSE interface to OpenGL, with Chris Logie
    2. Using DIVERSE with OpenGL Volumizer, with Alex Kalita
    3. Hands-on time in the CAVE and lab to work on your data