RIVA 1.0 Tutorial

Table of Contents

1. Machine Requirement
2. Installation
3. RIVA Architecture
4. Prepare RIVA Input Dataset
    4.1 Preparing data for the renderer
        4.1.1 Conversion to RivaFile Format from Raw data
        4.1.2 Adjusting the File Resolution
        4.1.3 Convert global data to the sinusoidal projection
        4.1.4 Tiling
        4.1.5 Writing the renderer's configuration file
    4.2 Preparing data for the Flexible Flyer
        4.2.1 Shrinking the data
        4.2.2 Converting the terrain image to IRIS RGB format
        4.2.3 Writing the Flexible Flyer's configuration file
5. Run A RIVA Program
    5.1 Run fly script to start the RIVA GUI programs
    5.2 Run render script to start the RIVA renderer
6. Running Flexible Flyer
    6.1 Starting Out
    6.2 Viewing Modes
    6.3 Viewing Buttons
    6.4 Control Panel
    6.5 Keyframe Editor
    6.6 Time Animation Control

    6.7 Additional Rendering Control


Welcome to the RIVA tutorial. The following pages will guide you through the basics of using RIVA, working with a small Earth dataset. We will start from RGB data and go over the data processing. For more details on certain a subject, follow the link to the appropriate section.


1. Machine Requirements

RIVA 1.0 consists two major components, the parallel renderer and the GUI programs.  The parallel renderer uses a combination of MPI calls and Unix System V shared memory library.  It has been tested on the SGI Origin system, but it should work on other SMP machines supporting MPI and shared memory library.  The GUI program, namely, flexible flyer, is built upon OpenGL and SGI's OpenInvertor.  Therefore, it only supports SGI platforms.  It runs properly on  SGI machines with texture memory, such as O2 and Octane.  It also runs on SGI machines without texture memory, but the performance is poor.

The parallel renderer requires 64 bit address space in order to handle large datasets.  The GUI programs are compiled with 32 bit address.

2. Installation

The RIVA 1.0 distribution contains three compressed tar files: riva1.0_bin.tar.Z, riva1.0_src.tar.Z, and riva1.0_data.tar.Z.  The riva1.0_bin.tar contains all the binaries and libraries for SGI IRIS 6.5.    The riva1.0_src.tar contains the source code for RIVA renderer, GUI program and all the utility programs.  Both tar files contain complete documents in html format, and sample scripts and scenerio files to run the examples documented in this tutorial. riva1.0_data.tar contains a small earth dataset for RIVA.  The examples used in this tutorial are all based on this test dataset.

Following are the steps to make the RIVA executables from the source distribution:

1. Untar riva1.0_src.tar in your home directory, say /home/yourname. RIVA code will be untar'ed into       /home/yourname/RIVA1.0 directory.
2. Add the following line in your .cshrc file:
    setenv RIVAHOME /home/yourname/RIVA1.0
3. Change directory to /home/yourname/RIVA1.0
4. Run "gmake all".  You have to use GNU make utility to make the RIVA binaries.

The following binaries will be made in $(RIVAHOME)/bin/ directory:
 

Router*           render*           rivglobe*         rivresize*
ff*               riv2notile*       rivheader*        rivshrink*
flit*             riv2ppm*          rivinfo*          rivsplit*
fly*              rivadd*           rivmake*          rivstrip*
hfb_host*         rivdel*           rivmerge*         rivtiler*
receive_display*  rivdem*           rivrange*         xshow*


And the following libraries will be made in $(RIVAHOME)/lib/ directory:

libMessager_32.a   libMessager_64.a   libriva_32.a       libriva_64.a
 

3. RIVA Architecture

The RIVA System contains a set of programs.  In general, they can be divided into three functional groups:
  1. The parallel renderer, called flit.  It runs in parallel on SGI Origin 2000.  flit is started by a host program, called hfb_host using mpirun.   Once started, it loads in the input datasets (images and digital elevation maps), then waits for rendering commands from hfb_host, processes the commands, and sends the result (either image or status message) back to hfb_host.
  1. The interface programs, hfb_host and routerhfb_host is the host program for the parallel renderer, flit.  It receives  and parses RIVA commands either from the RIVA GUI, Flexible Flyer (ff), or from a disk file, and sends the commands to flitto process.  It also receives and assembles the rendered images from flit and sends the final image to either the GUI or a disk file.  Currently, it runs on the same machine as flit, i.e, SGI Origin 2000.  It spawns the flit program by calling system() and uses socket to communicate with flit. Router is a symbolic routing server that facilitates the communication between the Flexible Flyer and hfb_host.  Additionaly, it also provides communication between Flexible Flyer and xshow, and from hfb_host to receive_display.    Router can run on either the rendering machine or the GUI machine.  It is more efficient to run it on the GUI machine if xshow is also used for display.
  1. The GUI programs, flexible flyer (ff), xshow, and receive_display. Flexible Flyer (ff) is the main RIVA navigator and control program.  It is built on top of OpenGL and OpenInventor using texture mapping.  A low resolution representation of the input dataset is loaded in a navigation window.  The user can rotate, translate, walk or fly over the dataset while generating viewpoint commands to the parallel renderer for final rendering.  Flexible Flyer is built with a reconfigurable control panel.  Commands such as vertical exaggeration, opacity adjustment, or any text command can be entered there and relayed to the renderer.  The renderer status and the viewpoint information can be displayed in the control panel as well.  In addition, the Flexible Flyer is equipped with a key frame editor.  It is a handy tool to design and preview a flight path for animation.  The Flexible Flyer can run with or without the parallel renderer, flit xshow is a 2-D map display.  It displays a low-resolution image as a 2-D map and the key frames/flight path generated by Flexible Flyer.  It is easy to lose orientation in Flexible Flyer when you fly too close to the terrain using a low-resolution dataset.  xshow tells you where your current location is by drawing a point on the map.  It is a great aid to the keyframe editor in Flexible Flyer.  Receive_display is a simple display program that receives the rendered images from a socket or from the Router and displays it on the screen.
The following functional diagram dipicts the relationship and the interaction among different programs in the RIVA system.

4.  Prepare RIVA Input Datasets

Before you run a RIVA program, you have to prepare your input dataset.  RIVA takes at least two input files, one image file and one digital elevation map (DEM).  RIVA has it own input format, call RivaFile format.  RivaFile format is similar to Vicar format developed by JPL.  It has a fixed sized header block followed by raw data.  The header block consists <keyword=value> pairs in ASCII.  In order to load RIVA data fast in parallel, RIVA files are pre-tiled and stored in tile order.  Each tile is preceded by a fixed size tile header.
A set of utility programs are included in this release to help users to prepare their input datasets.  The man pages for these utilities can be found in the main document index file.  To use RIVA utilities, you have to include $(RIVAHOME)/bin in your seach path.

Following is a step-by-step instruction for you to prepare your input dataset.  For a quick verification of your installation, we also included a small test data set in the tiled RivaFile format in data/ directory.  If you want to use this test data set instead of your own dataset, you can skip to Section 5.

The Raw Data

We will be using an Earth dataset. The files provided are already merged, pre-shrunk, and converted. However, these features will be described breifly for sake of completeness. The following files are provided:
earth_sm.riv
Earth image in cylindrical projection
earthdem_sm.riv
Earth DEM in cylindrical projection
tiled_earth.riv
Earth image, tiled, in sinusoidal projection
tiled_earthdem.riv
Earth DEM, tiled, in sinusoidal projection
smallearth_sm.rgb
A shrunken Earth image in cylindrical projection and in SGI's RGB format, used by the Flexible Flyer
smallearthdem_sm.riv
A shrunken Earth DEM in cylindrical projection, used by the Flexible Flyer

4.1 Preparing Data for the Renderer

We need to convert all terrain images and DEMs to RivaFile format for the Renderer.

4.1.1 Conversion to RivaFile Format from Raw data

If an image is stored in separate channels, they must first be merged into one Rivafile. The rivmerge utility can be used to merge the channels to make one Rivafile. rivmake can be used to attach a header to a raw file to make it a Rivafile. rivmerge and rivmake create a Rivafile header of 1024 bytes by default.

 After using rivmerge or rivmake, appropriate fields must be added to the Rivafile header one by one with rivadd. See the RivaFile Reference for more information about header fields. Notice the DEM has some fields (ZMETERS, ZDELTA, etc.) that the terrain image does not have.

The rivdel utility can be used to delete unwanted fields; rivheader or rivinfo can be used to view the contents of a RivaFile header. Since the provided datasets are already pre-processed, check that the file properties are satisfactory with rivheader or rivinfo.

% rivheader earthdem_sm.riv
RivaFile: earthdem_sm.riv
LBLSIZE=1024
TYPE='DEM'
NL=2160
NS=4320
BPP=2
PROJECTION='CYLINDRICAL'
PIXMETERS=8000
ZMETERS=1
SUNFORMAT=1
LONG0=-180
LAT0=90
LONG1=180
LAT1=-90
% rivinfo earthdem_sm.riv
RivaFile: earthdem_sm.riv
  Type: DEM
  Projection: CYLINDRICAL

Valid Image------------------------
  Samples: 4320
  Lines: 2160
  Bytes per Pixel: 2

Not a Valid Terrain Image----------
  BPP=2; should be at least 3

Valid DEM--------------------------
  North: 90 deg North latitude
  South: -90 deg North latitude
  West:  -180 deg East longitude
  East:  180 deg East longitude
  Pixel Size: 8000 meters
  Elevation Unit: 1 meters
  Elevation offset: 0 meters (Default; no ZDELTA field)
  Byte Order: Unix

rivheader gives fields as they are stored, rivinfo processes the header fields to see if it is a valid image or DEM.
 

4.1.2 Adjusting the File Resolution

RIVA expects that image file and the DEM file have matching geographical coverage.  In other words, the following keywords should be identical in both files: LAT0, LONG0, LAT1, LONG1.  The DEM and the image file usually have the same resolution. However, the image may have less resolution than the DEM. In that case, the pixel resolution of the image file has to be an integer multiple of that of the DEM. For instance, if DEM's resolution is 30 meter per pixel (PIXELMETER=30), the image can have resolution of 30 meter/pixel, 60 meter/pixel, 90 meter/pixel, etc.. When the image file and the DEM file have different resolutions, the tile size of each file has to be chosen to cover the same area. If a DEM file of 30 meter resolution is partitioned into 128x128 pixel tiles, the corresponding image file of 120 meter resolution has to be partitioned into 32x32 pixel tiles so that each tile covers the same geographical area of the surface.

Since the image files and DEM files are often obtained from differenct sources and with different pixel resolutions, many times, we would need to crop or resample the dataset.  RIVA provides rivshrink to shrink the dataset and rivresize to interpolate the dataset.

4.1.3 Convert global data to the sinusoidal projection

A Riva File can be in either cylindrical projection or in sinusoidal projection.  For a global dataset, it is more efficient in both disk space and rendering time if you store the data set in a sinusodial projection.   The rivglobe utility can be used to perform this conversion between the two projection systems.
% rivglobe earth_sm.riv earthglo.riv
rivglobe: reading RivaFile earth_sm.riv
rivglobe: Writing sinusoidal image earthglo.riv
% rivglobe earthdem_sm.riv earthdemglo.riv
rivglobe: reading RivaFile earthdem_sm.riv
rivglobe: Writing sinusoidal image earthdemglo.riv

4.1.4 Tiling

Internally, the input datasets are partitioned into small square tiles and distributed to each rendering processor's local memory.  For the renderer to load terrain images and DEMs faster, we pretile them using rivtiler. Sparse tiling is often used to eliminate blank space. Here, the tiled images are provided: tiled_earth.vic and tiled_earthdem.vic.

Grid widths should be chosen empirically; 64 is generally pretty good. Bigger files require bigger tiles.

4.1.5 Writing the renderer's configuration file

Once all of the files have been tiled, a configuration file is written to tell the renderer which files to load and their relationship. The renderer's configuration file (usually with extention .set) is described in detail in the Renderer Reference.

 Here is an annotated copy of earth.set file used for the full set of Earth data:

# earth.set
#
# Definition for Earth dataset
#
 
# FIRST, define symbolic names for files.  The name chosen for the
# terrain image is particular important, as the Flexible Flyer will
# use it as the name for the surface formed by the terrain image and
# its DEM.

DATA earthdem  tiled_earthdem.vic
DATA Earth tiled_earth.vic
 
# NEXT, combine the terrain images and DEMs into surfaces.  Order is
# important here, as the renderer will compose the surfaces in the
# order given.  Since we only have one surface, it doesn't really matter.
DEM Earth earthdem
 
# NEXT, state combination method.  In general, COMBINE OPACITY is
# always right.
COMBINE OPACITY

4.2 Preparing data for the Flexible Flyer

  The Flexible Flyer needs lower resolution data files for proper speedy execution.

4.2.1 Shrinking the data

The Flexible Flyer requires a terrain image (in SGI RGB format) and a DEM (in RIVA File format) for each surface, just as the renderer does. We will use the rivshrink utility to shrink the terrain image and DEM to the right size.

 NOTE: for the Flexible Flyer, all terrain images must be in cylindrical projection, not sinusiodal. In order to maintain reasonable interactive speed in Flexible Flyer, the optimal data file size for Flexible flyer is about 500,000 pixels for images and 5,000 pixels for DEMs.

The Earth dataset is 4320x2160 pixels. To get it to the right size, we will shrink earth_sm.riv by a linear factor of 4 and earthdem_sm.riv by a linear factor of 40. The resulting sizes will be 1080x540 and 108x54, respectively.

% rivshrink earth_sm.riv smallearth_sm.riv 4
rivshrink: shrinking RivaFile earth_sm.riv
rivshrink: shrink by a factor of 4
rivshrink: creating RivaFile file smallearth_sm.riv
Shrinking an Image.
rivshrink: new size is 1080 x 540
% rivshrink earthdem_sm.riv smallearthdem_sm.riv 40
rivshrink: shrinking RivaFile earthdem_sm.riv
rivshrink: shrink by a factor of 40
rivshrink: creating RivaFile file smallearthdem_sm.riv
Shrinking a DEM.
rivshrink: new size is 108 x 54

4.2.2 Converting the terrain image to IRIS RGB format

The Flexible Flyer uses OpenInventor to render the low-resolution surfaces, using the terrain image as a texture map onto a quadmesh produced from the DEM. OpenInventor likes its texture maps in SGI's IRIS RGB graphics format. Thus, the shrunken terrain images must be converted to that format. The easiest way to do this is to convert them first to PPM format using the riv2ppm utility. Then, any number of different packages (ImageMagick, XV, fromppm) can be used to convert the PPM image to IRIS RGB format.

 The following listing shows how to convert the small terrain images to PPM format:

% riv2ppm smallearth_sm.riv smallearth_sm.ppm

4.2.3 Writing the Flexible Flyer's configuration file

The configuration file tells the Flyer the names of the files making up each surface, and also allows the user to configure the Renderer Controls that are displayed. For complete information about the Flyer's configuration file, see the Flexible Flyer Reference or the Renderer Reference.

 The following is an annotated listing of 'earth_ff.set', which is used when interactively rendering the set of Earth data described above:

# earth_ff.set -- Flexible Flyer Configuration File
#
# Earth dataset

# Messager resources:  the Flyer sends renderer commands under the
# resource name RENDERER, and receives status messages from a resource
# named RENDER_STATUS.  At present, the renderer
# always sends status messages as RENDER_STATUS.
# Each data set usually gets its own renderer command resource name.
messager RENDERER RENDER_STATUS

# Surfaces:  for this data set, the Flyer will load one surface:
# the planet Earth.  The 'sphere' command is
# used for loading spheres, and the 'plane' command for loading
# smaller regions.  Note that the names used are the same as those
# used in the renderer's earth.set, shown previously.

#      Name    Terrain Image     DEM                  Radius in pixels
sphere Earth   smallearth_sm.rgb smallearthdem_sm.riv 3666.932


# Tags:  it is possible to attach text tags (e.g., place names) to a
# surface at any desired lat/long location using the 'tag' command.

# Controls:  These commands define a variety of Renderer controls.
# Note that a surface toggle and an opacity slider can be defined for
# a surface defined in the renderer, even though it isn't loaded 
# into the Flyer.

vertexag
opacity Earth
status

5. Run A RIVA Program

We now have data sets and configuration files for both the RIVA renderer and the Flexible Flyer and we are ready to run RIVA.  RIVA has only been tested on the SGI's platform.  The parellel rendering program, hfb_host and flit run on SGI Origin 2000 using MPI.  Flexible Flyer, xshow, and receive_display run on SGI workstations, such as O2, Octane, Onyx, as well as Origin.  Router can run on either the renderer's machine or on the GUI's machine.

5.1  Run fly script to start the RIVA GUI programs

Before you run any RIVA program, make sure $(RIVAHOME)/bin is included in your search path.  The RIVA 1.0 release includes two run scripts in $(RIVAHOME)/bin directory: render and fly.
Fly script starts Router, if it did not exist already, Flexible Flyer (ff), xshow and receive_displayall at once.  The sample fly script is shown as below:

#!/bin/csh -f
#
# fly name.set
#
# Runs the flexible flyer, making sure that the Router is running on this
# machine

echo fly $1
# NEXT, make sure the router is running
set j=`ps -ef|grep -v grep|grep Router`
echo $j
if ("$j" == "") then
    echo "Router not found, starting one...."
    Router &
endif

# NEXT, run the 2D map program, xshow, passing the same set file as argument
# display the image and flight path in 2D map
xshow -f $1 &

# NEXT, Start the receiving program: receive_display
#-s: receive from socket, -b: with border
#-p: portnum (default 7000)
# The next command uses socket connection with default port number 7000
#receive_display -s -b &
#
# The next command uses Router with resource name RenderTest and image size
# 640x512, The resource name has to match with the one defined for the router
# destination in flitrc.

receive_display -r RenderTest -f 640,512 &
#
# LAST, start flexible flyer
ff $1

To run RIVA interactively using Earth dataset, first you need to start the Router and GUI programs on your SGI workstation:

% fly earth_ff.set

Note in the sample fly script, we start receive_display using Router communication.  You have to edit the fly script if you wish to use socket connection instead.  Router connection is much slower than socket connection, but more flexible.    If using socket connection, you have to run fly script first, then render script.
If either hfb_host or receive_display dies for any reason, the socket connection will be broken and both programs will have to be restarted to re-establish the connection.  There is no such restriction if using Router connection.

If you use socket connection to receive rendered images, receive_display will display the following message when the socket is created successfully:

% receive_display -s -b
connected to port 7000
Go for it
After you see the above message, you can go ahead starting the renderer.  The display window will not be opened until the renderer is started and the socket connection is established.  The default port number used by receive_display is 7000.  It has to match with the port number defined for the output destination in flitrc.  If the port number can not be bound for some reason, you can either wait for a while and try again, or change to a different port using switch -p.  If you change to a different port number, you have to change the corresponding port number in flitrc.   See Renderer Reference and receive_display man pages for the command line arguments.

5.2 Run render script to start the RIVA renderer

Render is a script containing different scenerios to run  hfb_host.   A sample render script is shown below:
#!/bin/csh
#
# render
#
# Renderer command script -- all standard scenarios can be run using
# this script.
#

# FIRST, display usage if no command argument
if ($#argv < 1) then
    echo "USAGE: render scenario [npes]"
    exit
endif

# NEXT, set constants
set outdir  = $RIVAHOME/output
set defaultrouterhost = alhena

# NEXT, get scenario
set scenario = $1

# NEXT, get PEs
if ($#argv < 2) then
    set npes = 32
else
    set npes = $2
endif

# NEXT, echo inputs
echo "Running $scenario on $npes PEs."

# NEXT, set the router host if it's not set.
set i=`printenv ROUTERHOST`
if ($i == "") then
    setenv ROUTERHOST $defaultrouterhost
endif
echo "ROUTERHOST is $ROUTERHOST"

# NEXT, execute the desired scenario
switch ($scenario)
    case earth.test:
        hfb_host -c flit -p $npes -i earth.set -D diskmed \
                 -d $RIVAHOME/work/earth.flit \
                 -o $outdir/earth
        breaksw
    case earth.fly:
       hfb_host -c flit -p $npes -i earth.set -D routerlow \
                 -n RENDERER \
                 -o $outdir/earth
        breaksw
    case earth1.fly:
        hfb_host -c flit -p $npes -i earth.set -D socketlow \
                 -n RENDERER  -t 6500 \
                 -o $outdir/earth
        breaksw
    default:
        echo "Error -- no such scenario."
        exit 1
        breaksw
endsw
exit

You need to edit render script and change defaultrouterhost to the hostname where Router is running.  Alternatively, you can set an environment variable ROUTERHOST instead. If your SGI Origin 2000 is running a queuing system, such as PBS, you need to obtain the appropriate queue before running the render script.  For example, to get an interactive queue of 16 nodes for 30 minutes using PBS:

% qsub -I -V -lncpus=16 -lwalltime=00:30:00

After you get the queue, change directory to $(RIVAHOME)/work and do

% render earth.fly 16

earth.fly is one of the scenarios defined in the sample render script.  16 is the number of processors the renderer, flit, will run on.  Note the number of nodes has to be a power of 2.  If it is not given, it is set to 32 by default in the render script.  The above script actually calls hfb_host with the following arguments:

       hfb_host -c flit -p 16 -i earth.set -D routerlow \
                 -n RENDERER \
                 -o $(RIVAHOME)/output/earth

hfb_host spawns the parallel renderer, flit, on 16 processors.  After started, flit loads in the input datasets defined in earth.set.  If the input dataset is big, it will take a while to load the dataset, when the data is loaded, the following message will appear in your window:

               flit:  ready to render

It will render the earth datasets defined in earth.set by taking commands from the Router using resource name RENDERER.  RENDERER should  match with the resouce name used by the  Flexible Flyer to send the command to the renderer.  The resource name used by Flexible Flyer is defined in its configuration file, earth_ff.set.  The renderer generates images of type "routerlow". Routerlow is a output device name defined in a flit resource file (flitrc) in the current directory:

router  routerlow  640   512    RenderTest    RGB_REVERSE

It is a RGB image of size 640x512 with image origin defined at the lower left corner of the image.  The images will be sent to Router using resource name "RenderTest".  The images will be displayed by receive_display program.  You have to give the same resource name and frame size in the command line when you start receive_display.

The renderer can be started as a batch program without the GUI interface as well.  When it runs as a batch program, it takes input commands from a command file.  A sample command file, earth.flit, is included in the release in $(RIVAHOME)/work directory.  To run RIVA without GUI, do

% render earth.test 16

earth.test is another the scenarios defined in the sample render script.  It will render the earth datasets defined in earth.set using the flight path stored in $(RIVAHOME)/work/earth.flit and generate images of type "diskmed". The output images will be stored in $RIVAHOME/output with prefix "earth".  Diskmed is a output device name defined in a flit resource file (flitrc) in the current directory.  It is a PPM file of size 640x512 as defined in the  sample flitrc file.  You can modify or add any new devices for your own need.
For the hfb_host's command arguments, see Renderer Reference.

6. Running Flexible Flyer

6.1 Starting Out

Flexible Flyer can by used as a standalone program.  It is often useful to run it alone when you design your  flight path for a movie.    After you have your first flight path done, you can bring up the parallel renderer to check the quality of your key frames or render a test movie to verify the flight path.  Since the connection between ff and hfb_host is via Router, the two programs can be started or stopped independently without breaking the connection.  To start ff alone, do
% ff earth_ff.set
ff will fail if it cannot find a router. If this problem arises, give the following command before trying again.
% Router &
'earth_ff.set' will make a Vertical Exagerration slide bar, an opacity bar for the Earth data, and Status Message window displayed at the control panel.    A sample Flexible Flyer window is shown in Figure 1.

Flexible Flyer

Figure 1.  Flexible Flyer in the Examiner Mode

6.2 Viewing Modes

There are three different viewing modes for ff. They are in the pulldown menu under Viewers.

The 'Examiner' view allows for rotation of the data set with the left mouse button and translation of the data set with the middle mouse button. The right mouse button reveals a menu of options. The Dolly wheel at the lower right hand corner zooms in and out. The Rotx and Roty wheels allow for rotation about the x(horizontal) and y(vertical) axes.

The 'Fly' mode allows for lateral and vertical movement of the viewpoint. The left and middle mouse buttons counteract each other. To move to the right, press the left mouse button and move the cursor to the right. To slow, click on the middle mouse button. Clicking the left and middle mouse buttons simultaneously will stop all movement. The bar at the bottom of the viewfinder shows velocity. The blue bar indicates maximum velocity, the red bar shows current velocity. The more times one mouse button is clicked, the larger the blue bar will get. A bar to the right represents lateral forward motion. The Rotate wheel pans horizontally, and the Tilt wheel pans vertically. The Dolly wheel zooms.

FF in Fly mode

Figure 2.  Flexible Flyer in the Fly mode

The 'Walk' mode allows lateral movement without vertical changes. Hold down the left mouse button to move. The viewfinder will move where the cursor is dragged. The altitude and viewing angle can be adjusted independently with the wheels labeled Height and Tilt, respectively. The Height wheel actually translates the surface in the vertical direction, while the Tilt wheel pans in the vertical. The Rotate wheel pans left and right. The Dolly moves the viewpoint in a straight line perpendicular to the view window.

6.3 Viewing Buttons

At the right side of the Viewing window, there are eight buttons that control the viewing parameters:

This button is a cursor. It doesn't do anything but point.
This button allows for manipulation of the viewpoint in the three viewing modes.
This button opens a help window about the current viewer.
This button returns the viewpoint to a previously determined one. If no viewpoint was set, this button does nothing.
This button sets a viewpoint that can be restored with the  button.
This button zooms the viewpoint all the way out until the whole dataset can be seen.
This button zooms and centers to the point that is clicked on.
This button changes the projection of the dataset. When it looks like this, the projection is spherical. When it looks like , the projection is planar.

6.4 Control Panel

The ***Renderer Control Palette*** to the left of the viewing window displays  various renderer control functions.  These controls do not affect the flexible flyer, but send commands directly to the renderer. There are six built-in control functions in the Flexible Flyer as shown in Figure 4.  User can choose the default control functions in ff's configuration file, or use the Controls menu to toggle on or off any of the functions.

The six control functions are:

  • Vertical Exaggeration:  It changes the vertical exaggeration of a DEM dataset.  When moving the slide bar, the renderer sends a command "ZRES: demname exaggeration" to the renderer.  If you have more than one DEM files, you can have one slide bar per DEM.
  • Status Message:  This scrollable text window displays any messages sent from the renderer.
  • Opacity:  This slide bar changes the opacity of a particular image dataset while compositing the final image.  This is used when multiple datasets are rendered at the same time.  The order of the datasets defined in the renderer's configuration file determines the order of compositing.  The first dataset, also called the base dataset, in the configuration file will be at the bottom with an opacity of 1.  Each following dataset will be laid on top of the previous dataset.  The opacity of the top dataset will determine how much of the lower datasets can be "shown through" in the final image.  Again, one opacity slide bar is defined for every non-base image dataset.  When moving the slide bar, the renderer sends a command "OPACITY: imagename opvalue" to the renderer.  The opacity value is between 0 and 1.0.
  • Command List: This control function contains two text window.  The second one with a title "Renderer Command" allows you to type any renderer commands.  The command will be sent to the renderer when you hit "enter" and displayed in the window above the command window. Commands usually follow the form
  • COMMAND: [Dataset] [option]

    For instance, "SHADE: earth ON" turns on shaded-relief function on the earth dataset, and "DEST: routerlow"  changes the destination device to "routerlow".  For a detailed list of commands and usage, see the Renderer Command Language reference. These commands do not affect the flexible flyer.

  • Recorder:  This recorder function records and play backs the viewpoints generated by the Flexible Flyer.  It starts to record the viewpoints when you hit  button.  The viewpoints are stored in a file named rec.flit.  It stops recording when you hit  button.  It replays the recorded viewpoints when you hit button.  Once it is replayed, the file rec.flit is cleared.
  • Camera Position:  It displays the longitude, latitude, altitude, and view angle of the current viewpoint position.   This is a useful information for designing the flight path.  But, since the information is updated for every viewpoint, thus slowing down the rendering in Flexible Flyer.  Try to avoid displaying it when you are previewing a flight path.

6.5 Keyframe Editor

After familiarizing yourself with the flexible flyer, you are now ready to create a flight path. Under the Animation menu, select New to create a new animation file. The Open option will open an existing .anim file. When either New or Open is selected, the animation editor window will appear (Figure 5). The ff program will create a flight path with the key frames selected in the animator by interpolating on a spline. Upon selecting the desired viewpoint, click Append to add the key frame to the end of the list. Frame duration in seconds can be varied with the slide bar. Click a key frame in the scrollable window selects and hightlights the key frame.  Double click a keyframe will make an information window popped up.  The popup window displays the detail information of the selected keyframe.  Click OK to close the information window. The Insert button adds the desired viewpoint immediately after the selected keyframe. The Delete button removes the selected keyframe. The Change button updates the selected keyframe.  The Preview button allows you to preview the flight path from the beginning. Pause, Resume, and Stop buttons are the control buttons for the preview.   Pressing the Pause button stops the preview. Resume can be clicked to start the preview where it was paused. Stop terminates the preview; pressing the Preview button will restart the preview from the beginning.  You can also preview an arbitrary frame in the flight path by moving the Preview slide bar. The Frame Rate slide bar varies the frame rate per second.  You can also preview the entire flight path by select preview menu in the Animation pull down menu.   The multiplication of the Frame Duration and the Frame Rate determines the numbers of frames to be interpolated in between a pair of keyframes.  It can be changed per keyframe base. If you have a time-varying dataset and you would like to start time animation at a selected keyframe, you can click Start Time Sequence button when a key frame is highlighted. When the flight path is generated, the time step will advance at every viewpoint after the selected key frame. If you would like to play the time steps twice slower, you can choose the play speed as 50%. Right now, only 100% and 50% play speed are supported. The time sequence flight path generation only supports one time-varying image overlay and/or one time-varying vertical displacement datasets. If no time-varying dataset is present in the current run, the Start Time Sequence button has no effect.

When done, pull down the Animation menu and select Save As to save the animation to file. This saves the key frames and time intervals. The file extension for all animation files is .anim. To save the flight path for rendering, click on the Save Flight Path option. There must be at least 4 keyframes to create a flight path. All flight paths are saved with extension .flit.   Flexible Flyer uses a cubic spline algorithm to interpolate the flight path with the set of keyframes.

6.6 Time Animation Control

The Flexible Flyer provides a Time Animation control panel to view time-varying datasets. It will open when you select Time Animation under the animation menu. The time-varying dataset could be either a vertical displacement dataset or a horizontal displacement dataset. You can select either one or both of the datasets by clicking the checkbox next to the dataset. The vertical displacement will be added to the base elevation with a exaggeration selected using the vertical exaggeration slider. The horizontal displacement will be displayed as an overlay on top of the terrain image. The horizontal displacement dataset may contain multiple channels, say x component, y component, and magnitude. You can select any channel as an index to a color map using Select Channel pull down menu. You can also choose a color map by entering the name of the colormap. Note the colormap has to reside at the working directory where you start Flexible Flyer. You can enter a Frame Number in the text box and click Sumbit, or you can click one of the buttons at the bottom of the panel to control the animation. Once the Submit button or Play/Step button is clicked, the Flexible Flyer send a APPLY_DISP command to the renderer. Rewind button will rewind the time step to 1. Step button will step through the time sequence.

Note that if you construct your time-varying dataset as a color overlay, you can view your data without using the Time Animation Control Panel. In the control panel, you can add a slider to choose the time step of a specific 3D dataset and use a opacity slider to control its opacity. In order to add a time slider, add a renderer control command displace in the configuration file for the Flexible Flyer.

 

6.6 Additional Rendering Control

The drop down menu Renderer contains additional rendering commands.  Redraw sends a REDRAW command to the renderer to rerender the previous frame.  It is useful when you want to see the result after you change any rendering parameter without changing the viewing position.  Terminate Renderer sends a BYE command to the renderer to terminate the renderer. 

Followed by Terminate Renderer in the Renderer menu are a list of image data sets.  When rendering with multiple datasets, each dataset can be enabled or disabled.  Checking or unchecking each dataset in this menu will result in a command "ENABLE dataset" or "DISABLE dataset" being sent to the renderer.  Disabling dataset will speed up the rendering process.  Note if there is only one dataset, this command has no effect.

The last option in the renderer menu is called Mapper.  Selecting Mapper will cause a popup window called "Band Mapper" to show up.  RIVA can handle images with more than three channels, such as the LandSat TM dataset.  The mapper allows you to map any of the input channel (also called "band" in LandSat) to one of the three colors, i.e., Red, Green, or Blue.   To do that,  you choose Copy in  the Method box, and select one color out R, G, or B in the Color box on the left hand side, then you select a band number at the righhand side, then click Send.  You have to repeat the process  for each of the color bands.  Other than copy mapper, RIVA supports four more color mapping methods, namely, Color Indexing,Ratio, Guass Stretch,and Auto Ratio. You can use one channel of the image as an index to a color map by selecting Index in the MethodBox. Next, you choose a channel from the indexmenu and type in the name of the color map and click Send. In addition, you can also map the ratio of two input channels into one color channel by selecting Ratio in the Method Box.  This feature has not been tested recently, try it at your own risk.  Lastly, the mapper can provide Guassian streatch to each of the color band.   It remaps the histogram of a given color to a Guassian curve.  User can specify the percentage of data that will be cut off at the high end and/or the low end while remapping.  Again, this algorithm does not work for all the datasets.  Try if with caution.  Following is the Band Mapper window for guassian stretch.  Each different mapping method is corresponding to a different commands, namely, MAPCOPY, MAPINDEX, MAPRATIO, MAPGUASS, and MAPAUTORATIO.

All the render controls can also be issued using the command list in the Control Panel.   See Renderer Command Language document for a complete list of commands.

See Also

  Renderer Reference , Renderer Command Language , Flexible Flyer Reference
  RivaFile Formatxshow, receive_display

back to documentation  beginning of tutorial  back to RIVA home

Privacy / Copyrights
FIRST GOV   NASA Home Page This page, http://pat.jpl.nasa.gov/RIVA//public/RIVA/tutorstart.html, is maintained by Peggy Li and was last modified Tuesday, 26-Aug-2003 13:37:02 PDT, CL 03-2169
spacer