OpenGL Visualization Tool
VarView Visualization Tool
VarView is a 3d visualization tool designed to work with Excel and other COM
enabled applications to produce surface plots, 3d scatter plots and other types
of visualization. It uses OpenGL, a graphics language implemented by most video
cards, to produce stunning images. The user can control
lighting, surface properties, and coloring, and can rotate and zoom around the
image. Each image can have a title, subtitle and footer. Images can be saved
to BMP, JPG, GIF, TIFF and PNG formats, and can be printed at high resolution
on color or black and white printers.
VarView has its own command language. Commands can be entered directly in a
COM command window, which can be embedded in Excel, Word, PowerPoint, Explorer
etc., or processed via script through a command handler object which does not
need a window. In addtion, VarView commands can be combined into text files
and run through the command handler in batch mode.
The help file contains a command window and
a list of all the commands. In addtion there are several script
files included in the distribution.
Send questions or comments to firstname.lastname@example.org.
To use VarView, down load theWindows 2000/XP MSI Installer
VarView installs in the directory C:\Program Files\VarView. The installer adds
a link to the help file and to the Excel demo spreadsheet
There is an Excel Add-In, VarView.xla, in the bin subdirectory.
The add-in helps you use VarView from Excel. The add-in is automatically installed
when you run the demo spreadsheet.
Once you have downloaded and installed the software, here are some basic
examples to get you started. Remember all commands are lower case and case
sensitive. Spaces are important. None of the examples will work until you install
The Excel add-in installs a menu bar like so:
The command are:
- 1. Execute active cell
- Executes the command in the active cell as if it were typed into the command
- 2. Execute current region as a script
- Executes the vertical block of commands from the active cell down to the
next empty cell in the same column as though each were typed into the command
- 3. Show last return value
- Pops a dialog box with the last return value from the command handler.
- 4. Print
- Pops the print dialog box to print the active window.
- 5. Save
- Save the active window as a BMP, JPG, GIF, TIFF or PNG file. Operates using
the BMP etc., script files. See savex
for more information.
- 6. Tile all windows
- Tiles all graphics windows. Low tech at the moment; assumes you have a 1600x1200
- 7. Cascade all windows
- Cascades all graphics windows in the top right hand corner of the screen
- 8. Kill all windows
- Kills all graphics windows.
- 9. Animate plot
- Rotate the actors in the graphics window. You can also move the plot by
left-clicking in the window and holding the button down. The scroll button
zooms in/out. The left/right and up/down arrows also move the actors.
- A. Toggle lights on/off
- Turn lighting in the plot on and off.
- B. Toggle colored/white light
- Toggle lighting between colored lights (red and green) and white light.
See lights and lightpos
for more information on lights.
- C. Toggle wireframe or surface
- Toggles rendering mode between fill, wire front fill back, fill front wire
back and wire front and back. See frontfill,
- D. Get Model Position
- Captures the current model position, see modelview.
- E. Set Model Position
- Set the model position to the value returned by the last Get Model Position,
button D. This allows you to have multiple windows with the same orientation.
To set the position programmatically use @pos.
- F. Insert image from active cell
- Select a rectangular range where the cell (x,y) represents the value f(x,y).
Click button 13 to insert an image of the range where color indicates value.
- G. Insert surface from active cell
- As 13 only inserts a surface. See surface.
- H. Insert xyz scatter plot from active cell
- Select a range of 6-tuples (x, y, z, r, c, a) where (x,y,z) gives a point
in space, r is a radius, c is a value mapped to color and a is a value mapped
to opacity. Produces a plot of spheres of radius r at (x,y,z) with color c
and opacity a. See xyxplot.
- I. Insert lollipop plot from active cell
- As 15, except each sphere is joined to the plane z=0 by a thin line, giving
the impression of a field of lollipops (hence the name!). See lollipop.
- J. Pop command window
- Shows a command window on a VBA form. Any of the commands discussed so far
can be typed directly into the command window.
- K. Help on command in active cell
- Type a command in the active cell and click 18 to see the help topic. See
help for more. Try with help for more
on using help!
Abbreviations and Let
Temporary and permanent variables (abbreviations) and snippets of code can
be created using the let or abbrevs command. These are called using @cmd. For
> let test surface f peaks
defines a temporary variable call test. Typing
calls this variable. It is the same as entering "surface f peaks"
at the command line. Type abbrevs for a list of currently defined abbreviations.
Many common colors are defined as abbreviations, so
> color bg @olive
will set the background color to an olive green. Typing
> echo color bg @olive
will echo back to the command window what the command expands into.
Script and Abbreviation Examples
There are several script and abbreviation examples included in the distribution.
You can look at the scripts in Notepad, or another text editor, to see how they
work. To expand the abbreviations use the echo
- @bmp, @gif, @jpeg, @png and @tiff
- These scripts save the active window in the indicated format. For example
jpeg c:\temp\abc.jpg will save the active window as a 1600x1200 JPEG file.
They all use the savex function.
- Makes the active window fullscreen, Shift+left mouse click to restore the
- Toggles smooth rendering mode and white light. Fallable if you have changed
- Example of surfaces with different textures. Shows how to include multiple
actors in one plot and how to position the actors.
- Example of animiation. This will not work with the application as shipped.
You need to be able to create fvm files for it to work.
- Example of the body brush. You need a 3DConnexion SpaceBall for this to
- cmap [colormap name]
- Displays the colormap colorbar and shows the RGB ramp functions that make
up the colormap. Try cmap copper for an example.
- Demonstrates making custom colormaps
- Four different surface plots showing how to control title and subtitle,
change font, size, colors etc. Note that the title etc. is not shown when
the plot is moving because the display flickers.
- Four surface actors in one plot, with the spring, summer, fall and winter
- Three surfaces with different textures. Use the mouse to move this plot
- A nice toy.
- More texture demos.
- Example of 3d scatter plot and lollipop plots.
Excel Spreadsheet Examples
In addition to the add-in, the installation includes a demo spreadsheet (Start->Program->VarView->VarView
Demo Spreadsheet). Running the spreadsheet will automatically install the VarView
Excel add-in. The spreadsheet contains some starter examples and the named ranges
plot1 and plot2 which are used in the basic examples.
(c) 2003 Stephen