Copyright: WoolleySoft Ltd 1997


Contents

• Introduction

• The Visual Terrain Main Window

• Defining a Map from Imported Data

• Defining a Map from a Graphics Image

• Defining a Map from a Scanned Image

• Exporting Data

• Creating Actors

• Interfacing to Other Programs


Introduction

Before viewing a landscape with Visual Animator you must define the shape and contents of the surface that you wish to examine.  Visual Explorer holds surface information in the form of a rectangular grid.  The grid (sample) points hold the heights, whilst the grid (terrain) squares the type of terrain.

The grid dimensions may be defined in kilometres, miles, or metres, with grid point spacing in metres, feet, or tenths of a metre respectively.  Maps must be defined with between 400 and 161,000 sample points.  Realistic looking landscapes usually require 10,000 sample points or more. However, very large maps are slower to manipulate and draw, and for most purposes between 25,000 and 75,000 points is probably the best trade-off.  Data is stored in .lem files, usually referred to as maps.

To create a map for a landscape surface each sample point must have its height set.  Visual Terrain offers four ways of doing this-

1. 	The data may be imported directly from a digital terrain data file, such as Ordnance Survey NTFs, Vistapro DEM or USGS DEM.

1. 	A graphics file may have it's colours mapped as height values.  This is similar to importing data from a digital terrain data file, but there are some additional considerations.

1. 	Information may be captured from a scanned image of a topographic (contour) map.

1. 	The landscape may be designed 'from scratch' by the user. The techniques used are essentially the same as for creating a landscape from a scanned image, so this will not be discussed separately.


Layout of the Visual Terrain Main Window
The Visual Terrain Main Window

The main form has three main parts:

1.	A Toolbar that gives access to the tools you will require to define the map.

1.	The Parameter Display area down the left hand side of the window which shows various status information about the map and the tools being used;

1.	An initially blank area representing the 'Canvas' used to define the map.


The Canvas

The Canvas can display four types of information: sample point heights, terrain types, overlay objects, and a background bitmap.  It is possible to disable the display of any of these items using the Map Status page of the Parameter Display Area.

Sample points

These are usually displayed as small solid squares.  The precise size of the square will vary depending on the display size of the map canvas area and the magnification being used, but should be optimised to display a large enough square for the colour to be apparent whilst remaining small enough so as not to obscure any background bitmap, although this may not be possible with very large maps.  No squares are shown for undefined heights, and sample points at sea level (zero metres or feet) are always shown as single points.

At high magnifications a numeric value is displayed instead of the solid square.

Visual uses a range of 15 solid colours to indicate into what range the height of a sample point falls.  The current ranges and associated colours are shown in the Parameter Display area to the left of the map canvas.  You may adjust the total displayed range using the Display Parameters tool.  The scale self-adjusts when loading, importing, or interpolating data, but otherwise should be explicitly refreshed.

Terrains

These are displayed by outlining the squares of any particular terrain in the corresponding colour.  There are eight different pre-defined types of terrain, default or base, water, wood, town, road, rock, sand and snow/ice.    A further 16 terrains types are available for definition by the user.

Unless explicitly defined otherwise, all grid squares are assumed to have the default terrain (in most colour schemes used by the Landscape Viewer this corresponds to low level vegetation) which is not displayed on the canvas.  Any group of grid squares that does not have the default terrain is shown outlined with the appropriate colour.

Overlay Objects

These are items such as lines and circles that will be drawn on top of the landscape surface.  They are handled in a very similar manner to drawing objects in a CAD program.

Background Bitmaps

A background bitmap is used when creating a map from a scanned image.  A windows bitmap (.bmp) file is placed 'behind' the canvas and used as a guide for designating heights and terrains.  The image is always stretched to exactly fit the canvas window (note that this behaviour differs from Visual Explorer 1).


The Parameter Display Area

The Parameter Display area, drawn to the left hand side of the canvas, displays status and similar information about the current map.  It is a notebook control and contains four pages - Heights, Terrains, Objects and Map.

Heights

This page displays the colour bands used for drawing heights.  The sequence of colours is fixed but the effective range may be changed using the maximum and minimum height controls.  The band information is updated automatically as these are changed, but once a suitable range has been selected the map should be redrawn with these new colours by clicking the Redraw button on the toolbar.

Visual Terrain will automatically adjust the effective range when loading maps from file, importing data, or after interpolating heights.

Terrains

This page displays the available terrain types.  They are grouped into standard and user-defined terrains.

Standard terrains have a special meaning to Visual Explorer.  The colours of most of these may be altered, but the names are fixed.  Visual Animator has special rules for processing some of these terrains, but even if no special rules are used, it is advisable not to use a standard terrain for a purpose other than that described to avoid conflicts in future versions of Visual Explorer.

Up to 16 user-defined terrains may be defined and both the colour and name can be edited.  The currently selected terrain is shown below the terrain key.

To change the terrain definitions click on the Edit terrains button at the bottom of the page.  This displays the terrain definition dialog, which is the same as the terrains page of Visual Animator's projection parameters dialog.  This dialog can also be accessed from the Edit Terrains item on the Tools menu.

Objects

Objects are simple shapes that can be defined in Visual Terrain in a similar way to a CAD program.  This page contains controls used to define these objects.

All objects are simple line drawings, and the Pen colour and Line width controls set the style used.  A preview of how the current settings look is displayed in the Sample box.

The Shape box contains 6 push buttons which select the shape to be drawn.  These are activated when the Edit objects button on the toolbar is clicked.  The available shapes are freehand pen, straight line, segmented line, symbol (a cross) and ellipse.  In addition the arrow cursor is used for selecting objects.  Selected objects are highlighted by eight anchor boxes - drag these to resize the object, or drag the object itself to move it.  Clicking the right mouse button displays a pop-up menu with the options of moving the object to the back or front of the object stack, applying the current drawing properties to the object, or deleting the object.

Map

This page displays information about the map being displayed.  The show group contains a set of check boxes that can be used to turn on or off drawing of types of object in the canvas.  The trace parameters contains two controls: colour tolerance adjusts the range of colours that the auto contour trace facility will follow, the density control sets the density of points that will have their heights set by both the manual and auto-contour trace.


The Toolbar

The toolbar gives access to the various functions required to define a map.  These can be divided into fours groups: Map display functions, Heights definition tools, Terrain definition tools, and Overlay object tools.  A Cross Section may also be generated for any part of the map.


Map Display Functions

These tools allows the user to zoom in and out of the map canvas.  Clicking on the '+' button zooms in, and on the '-' zooms out.  You can increase the magnification by repeated clicking of the zoom in button, which is disable when the maximum magnification is reached.  Pressing the Toggle magnification button toggles the magnification between the default and the last selected value.

The program handles the canvas in exactly the same way at all magnifications, the exception being that heights are displayed numerically when sufficient room is available.

The Redraw button redraws the canvas, applying all current drawing parameters.  If a background bitmap is required use the Load background bitmap button to prompt for a file to load.  Typically this would be a scanned image of a topographic map.  The bitmap is stretched to exactly fit the map being defined.

All sample point heights and terrains are displayed (if enabled) superimposed on the background bitmap, which is typically used as a template for defining map information.


Height Definition Tools

The Spot height tool displays the height of the selected grid point.  Enter either null or a height between 0 and 9999 metres/feet. (999.9 for micro-metric maps).  If entering several points at the same height the Default height tool can be used to set each grid point to the last height entered with the spot height tool.

The Manual contour trace tool is used to set a series of sample points along a line to be set to the same height.  Typically this tool would be used to trace the contour lines on a bitmap loaded as background.

The tool uses a combination of the left and right mouse buttons or clicks and double clicks.  To start a contour press the left mouse button.  You may now either move the mouse whilst holding down the button, or release the button and click again at another position.  In both cases a red line highlights where the contour will be placed.  Continue defining the contour using any combination of these actions until complete, then either double click the left button or click the right button.  A dialog box prompts for the height of the contour, which must be between 0 and 9999 metres/feet.

The Auto-contour trace tool is also used to set a series of sample points along a line to be set to the same height.  It traces the contour lines on a bitmap loaded as background, and behaves in a similar manner to the Manual contour trace.  Your background bitmap must be black or colour detail on a white background.

The auto-contour tool works by following a selected line.  It is colour-sensitive, and give best results on scanned image if they are 'cleaned up' using a paint package an/or the Map Filter utility before use.

To start tracing a contour press the left mouse button over a contour line.  The program will now proceed to follow the line over the image, reversing the line colour as it does so. On completion a dialog box prompts for the height of the contour.

By default, the trace only follows pixels of exactly the same colour.  However, when using the tool to trace contours from background bitmaps with 256 colours or more you may find it useful to widen the range of colours recognised as belonging to the same contour.  To do this use the Trace tolerance slider on the map page of the parameters notebook.

The last contour line created by both the manual and auto contour trace tools can erased by selecting the undo function from the edit menu.

Blocks of grid points may be set to the same height using the Area heights level tool.  Click and drag using the left mouse button to define a rectangular area.  On release a dialog prompts for a height between 0 and 9999 metres/feet (or null) to which all sample points within the area will be set.

Finally the interpolate heights tool will interpolate the heights of undefined (null) grid points, and would typically be used after defining a representative sample of points.  Interpolation is fully described in the following section.


Terrain Definition Tools

The Spot terrain tool allows terrain squares to be 'painted' to a particular terrain type by moving the mouse with the left button held down.  Squares are set to the active terrain type, which is set on the Terrain page of the Parameters Display Area.

Larger areas can be set using the Area terrain tool.  Click and drag using the left mouse button to define a rectangular area.  On release a dialog box prompts for the terrain type to which all the terrain squares in the defined area will be set.

The Flood tool flood fills any flat area of the map with water.  After defining the shape of your landscape click on a suitable terrain square.  If the four bounding sample points define a flat square a dialog will prompt for confirmation that all contiguous flat terrain squares at the same height are to be set to water.


Overlay Objects Tools

The Edit Objects button tells Visual Terrain that the user is editing overlay objects.  The actual object tool being used is selected from the Objects page of the Parameter Display area.


Cross Section

The Cross Section tool is used to generate a simple cross section along a segmented line.  It is useful for following the rise and fall over a path as well as generating the more traditional simple cross section.

When the cross section tool is selected the section window is displayed.  It is hidden when the cross section tool is deselected.

The graph appearance can be altered from the Graph menu item.  The graph background, axes and grid line colours can be set, as can the use of vertical and horizontal gridlines.

Section segments are defined by clicking at a start and end point on the map canvas.  A double click is used to terminate a section.  The section graph is automatically scaled to fit the curve.

Once defined a section can be printed, saved as a bmp file, or copied to the clipboard as either an image or a series of x-y co-ordinates for subsequent import into a spreadsheet or other graphing package.


Defining a Map from Imported Data

Overview

This is probably the easiest and most accurate method of generating a map although, with the exception of the XYZ file import, only height data can be imported.

Visual Terrain can import the following data types:

•	ASCII Text

•	US Geological Survey DEM

•	UK Ordnance Survey NTF

•	Vistapro DEM

•	XYZ Attribute

In addition some other file formats, such as Japanese SEM files, may be converted to XYZ format before  importing.  See the Utilities directory on the CDROM for details of available programs for doing this.

The procedure for importing data differs in detail according to the source file being used.  However, in general the steps are:

1.	Select Import... from the Tools menu. This displays a File Open dialog.

1.	Select the type of data source you wish to use from the File Type drop down list box.

1.	Select the import file.

1.	Depending on the type of data source to be used an Import Parameters dialog box may be displayed.  This is described in more detail in the sections on specific import source types below.  Set any required parameters and click on OK.  The data is then imported and displayed on the map canvas.

Once displayed imported data is handled in exactly the same way as directly enter data.  You will probably want to add terrain information or possibly edit the imported heights data.  The facilities available for doing this are described in the Toolbar section.

In most cases you will let Visual Terrain create a map of the correct size and grid point spacing using the data from the import file.  Sometimes however it is necessary to import into a previously defined map (particularly with USGS DEM files).  See the Create New Map topic for details.


ASCII Text Files
Import ASCII Text Files

This function imports a set of heights data from a text file.   This should be in ASCII/ANSI space delimited text format - that is a text file which you can view using Notepad and consists of numbers separated by spaces or new lines.  This type of file is, for instance, created by the Lotus 1-2-3 extract function.  Similar files in comma delimited format can be converted to space delimited using the global find/replace function in any word processor.

The Import Parameters dialog is not displayed.  Instead the Visual Terrain imports data in a linear fashion starting at the top left corner of the map progressing left to right within top to bottom through all grid points.  The program expects an exact match between the total number of grid points in the map and data values in the file and will report an error if an incorrect number of heights is encountered.

ASCII import is fairly basic in nature, and if you are developing a program or macros to export data from another application you are recommended to use the XYZ attribute Import.


US Geological Society DEM files
Import US Geological Society DEM files

This tool allows the user to import a set of heights data from a US Geological Survey digital elevation model (DEM) file.

Visual Terrain was designed to process 7.5 minute DEMs and this is the only type officially supported.  The software can usually successfully import the larger 1 degree DEMs, but these are not officially supported. The preferred approach with these files is to use the conversion utility supplied with Vistapro to first convert them into Vistapro DEM format.

Note that USGS DEMs are not in the same format as Vistapro DEMs.

A typical DEM file will contain many more grid points than Visual Terrain can handle directly, and the import parameter dialog is displayed to allow the user to specify how the data from the import file will be mapped on a Visual Explorer map.


Import Parameter Dialog

Sample Size

Specify X and Y offsets from the origin used by the imported data.  For DTM files this is the south west corner (bottom left on the map display canvas).  Hence if you specified an X,Y offset of 50,80 the point at 50,80 in the imported data is mapped onto the bottom left corner of the map display canvas (0,0).  Similarly the point 60,100 from the import data would be mapped onto 10,20.

Note that USGS DEMs may have differing numbers of elevations per profile, particularly for the first and last few profiles.  In this case it is advisable to apply offsets that will not import data from these profiles.

Sampling Frequency

Specifies the frequency at which points from the imported data will be mapped onto the map display canvas.  A value of 1 implies all points will be mapped, 2 implies every second point etc.

New Map/Load into Current Map

Choose between automatically creating a new map with the correct dimensions for the imported data, or importing into the current map.  With USGS DEM files only import into the current map is available.

Origin X/Y Co-ordinates

Only activated when the import into the current map option is selected, these two values set the position of the map origin that the import will use.  This facility enables data from multiple import files to be tiled together, hence creating maps spanning the edges of import files.

Overwrite

Only activated when the import into the current map option is selected.  When checked all existing values in the map will be overwritten by imported values or set to the default height.

Default Height

Some import files may not contain data for all points on the map definition canvas.  You can therefore provide a default height.

File Loading Errors

If an error is encountered while attempting to load the DTM file the process will abort and an error message is display.  DTMs may fail to load for a variety of reasons, some of the more common ones are listed below.

•	Invalid Offsets:  You have chosen import offsets such that the DTM contains no data for the area to be imported.  Change the offsets and try again (an offset of X=0,Y=0 and a sampling factor of 1 will never produce an error from this cause).

•	Invalid DEM type:  You are attempting to import a DEM file of a type not recognised by Visual Terrain.  This is most likely to be a 1 degree USGS DEM - which can often be recognised by their very large file size (typically about 10Mb), or Vistapro DEMs - which have a completely different format.

•	DEM file does not contain end-of-line markers:  Some DEMs available on the Internet were loaded without end-of-line markers being present.  Visual Terrain cannot process these correctly.

•	DEM file is corrupt.  Some DEMs available on the Internet are simply corrupt - for example containing null lines or with end-of-line characters in inappropriate places.


UK Ordnance Survey NTF files
Import UK Ordnance Survey NTF files

This facility is used to import data from files produced by  the UK Ordnance Survey.

Support is currently limited to the Land-Form PANORAMA Digital Terrain Model Data (DTM) files produced from the Landranger series of maps.  This data can be obtained from the Ordnance Survey (Tel. 01 703 792773).  A free sample can be obtained covering the Port Talbot area of Wales and, if you are an educational user Gower, Peak District, Lake District, Bristol and Glasgow are also available under the CHEST agreement.  Please note that Visual Terrain cannot process the alternative PANORAMA vector format files, however these can be imported indirectly using the NTFtoLEM utility.

Each DTM file covers a 20km x 20km area with height values at each intersection of a 50 metre horizontal grid.  Visual Terrain can import all the grid points in a DTM into a single map.  However as this is a large number of points which may be unwieldy for many purposes Visual Terrain displays the import parameter dialog before reading the data.


Vistapro DEM
Import Vistapro DEM

This imports Vistapro 3 small (258 x 258) DEMs, a suitable sized map being automatically created by Visual Terrain.  Used in conjunction with the export Vistapro DEM facility it provides a simple method of editing Vistapro DEMs.  If you wish to use the imported information solely within Visual Explorer you may find a lower resolution than 258 x 258 to be more convenient.  A simple method of obtaining this is to import the DEM, export immediately as an XYZ attribute file, then re-import this file, but setting the sampling frequency to 2 or greater.


Import X,Y,Z, Attribute

This facility is designed to import data exported from commercial GIS programs such as MapInfo, or generated by other Visual Explore utilities such a Visual Grid, our utility for generating regular grid points from scattered data.  It is a general file format that allows a complete map to be defined including size, terrain and heights information.

The import parameter dialog is displayed to allow the user to specify how the data from the import file will be mapped on a Visual Explorer map.


Defining a Map from a Graphics Image

Overview

Visual Terrain can generate a surface directly from a graphics file.  This is useful as some surface data is available in this format, and it can also be used for creating surfaces from non-landscape sources, such as pictures of the Mandlebrot set.

The graphics file must be in bmp format.  If your file is in a different format is can easily be converted using a utility such as Paintshop Pro.  Visual Terrain creates a map of the same dimensions as the graphics file, mapping each pixel to a grid point.

Each pixel in the graphics file logically consists of three numbers representing the red, green and blue components of the pixel, each of which can be any value from 0 to 255.  Visual Terrain combines these values to calculate a single number, which it then converts to a height.

The three colour components can be combined in any one of six different ways depending on the order in which the components are processed.  For example if and order of Red, Green, Blue is selected then the number is calculated as

(Red-value * 256 * 256) + (Green * 256) + (Blue).

To convert this to a height Visual Terrain takes this as a fraction of the maximum value and multiplies this by the value entered for the maximum height  in the graphics import dialog.

Importing a Graphics file

Select Import… from the Tools menu.  When the read file dialog is displayed choose Graphics file (bmp) as the file type, select a bmp file to import, and click OK.  The Graphics file import dialog is displayed.

Set a maximum height value and choose an order for colour components processing from the set of six radio buttons.  You will also need to specify a grid point spacing in metres (graphics file import always imports into a metric map).  Press ok to start the import.


Defining a Map from a Scanned Image

Overview

One of the most powerful features of Visual Terrain is its ability to create a three dimensional model using information obtained from a topographic map (i.e. one with contour lines).

Capturing sufficient information from a map to define how a landscape surface looks is obviously a considerably more difficult problem than simply importing data from a file.  As all points in the map grid must be defined, creating a typical map involves defining the heights at over 10,000 grid points.

Fortunately Visual Terrain has been designed to address and simplify this problem.  The strategy used is to define a sub-set of heights, then use a set of interpolation functions to calculate the undefined heights.  Remarkably good results can be achieved using this approach.

To help define the original sub-set of heights Visual Terrain allows the use of a scanned image as a template.  The quality of this scan is of crucial importance in obtaining good results and you should attempt to produce the clearest image you can.  If you intend to use the auto-contour trace tool without having a colour scanner, some time spent 'cleaning up' the image using a program such as paintbrush is recommended.

See the Toolbar topic for a full description of the tools available.

To define a new map the user would typically go through the following steps...

1.	Create a new map of the appropriate size and grid spacing using the new map tool.

1.	Use the display parameters tools to display a full range of colours for the variation in heights expected.

1.	Import and size a bitmap of the original paper map using load bitmap  and set bitmap magnification map definition tools.  This would typically be created as a .bmp file using a scanner.

1.	Define a sufficient set of heights to give a reasonable definition of the shape of the landscape surface - typically by using the contour, spot and block height definition tools.

1.	Use the interpolate heights tool to fill in undefined points.

1.	Define any areas that do not contain the default terrain type (low vegetation) using the terrain tools

1.	Save the map and view using the Landscape Animator.


Creating a New Map

Select New… from the File menu and select the appropriate parameters from the dialog box.

Units

This drop-down list is used to select the measurement units that will be used.  Once a map has been created these cannot be changed.  Metric is the default and should be used for all metric maps of 1 kilometre or more square.  Both grid point spacing and heights are defined in whole metres.

For smaller sized maps Micro-Metric should be selected.  This allows heights to be defined to the nearest 0.1 of a metre.  Finally Imperial defines grid spacing and heights in feet.

Size

Enter the required number of grid points for both the length and width of the map.  The final dimensions of the map is displayed.

Defaults

A set of predefined map dimensions are available from this drop down list for Vistapro DEM and UK OS NTF files.


Opening and Saving defined Maps

The following are available from the File menu.

Open Map

Opens an existing map file.  A dialog box prompts for a *.lem file to be selected.

Save Map

Saves changes to the map you have been working on.  When you choose Save, the map remains open so you can continue working on it.

Save Map As

Saves a new or existing picture as a .lem file.  When you choose Save As, the map remains open so you can continue working on it.


Interpolation

This tool will interpolate the heights of undefined (null) sample points.  After defining a representative sample of points, for example along contour lines, this facility enables heights to be derived for the remaining undefined points.  This version of Visual Terrain offers two interpolation algorithms,  an  implementation of the Natural Neighbour algorithm (nngridr), which should be used to interpolate the majority of missing heights, and a trend analysis/smoothing transform, which should be used for filling in the last few points once the majority of heights have been interpolated.

The Interpolation Process

You should broadly follow the steps outlined below:

1.	Define a representative set of points, for example using the spot height and contour line tools.  See the item on interpolation considerations below for more information.

1.	Select the interpolation tool from the button bar and click and drag to define an area to be interpolated.  After the mouse button is released a dialog box will be displayed to confirm that interpolation is to be started.  Fill in the appropriate parameters for nearest neighbour interpolation (see below, but these will be the defaults when using the interpolation tool for the first time) and press OK to commence.  Whilst calculating a dialog box will be displayed showing progress and allowing cancellation of the calculation.

1.	If possible it is best to interpolate all points in one calculation.  Unlike previous versions of Visual Explorer, Visual Terrain has no practical limit on the number of grid points that may be interpolated.  However in cases where interpolation is to be used to 'fill in' missing areas from a map (for example, to recalculate heights after altering an area of a landscape) smaller areas can be processed individually.  In all cases however you should aim to fill in 95% or more of all points using Nearest Neighbour interpolation.

1.	Finally, if there are any missing points, or you wish to smooth the surface, click the mouse anywhere on the canvas to start interpolation again.  Select the Trend Analysis/Smoothing radio button, set the check boxes as required to apply trend analysis and/or smoothing, then click on OK.  Both trend analysis and smoothing apply to all grid points.

The Interpolate Heights Dialog

The following parameters may be set:

Use Nearest Neighbour/Trend Analysis.  This pair of radio buttons determines which interpolation algorithm will be used.  Controls not used by an algorithm will be disabled.

Use calculated gradients.  Used by Nearest Neighbour interpolation.  Defaults to ON.  Uses gradients to estimate the trends in the data when checked.  For example, a rounded hilltop will be deduced if points are available around a hill, but not on top.  If turned off gradients will not be used and a flat top will be deduced.

Optimise for speed.  Used by Nearest Neighbour interpolation.  Defaults to ON.  Calculates faster by making more generous usage of memory.  When turned off requires less memory but is significantly slower.

Extrapolate.  Used by Nearest Neighbour interpolation.  Defaults to OFF.  Enables extrapolation when checked.  This is by its nature a tenuous proposition, and should be used with caution after the majority of the map heights have been defined directly or by interpolation.  Note that it is advisable to define as many grid points as possible on the edges of the map, and particularly at the corners, as this reduces the amount of extrapolation required.

Tautness Parameters #1 and #2.  Used by Nearest Neighbour interpolation.  These two parameters control the 'taughtness' of the generated surface around the points already defined.  Increasing the value of parameter 1 increases the influence of the gradient, increasing the value of parameter 2 increases the area over which the influence of the gradient is felt.  Reasonable ranges are 1 to 3 for parameter #1, and 5 - 12 for parameter #2.

Minimum Height.  Used by both interpolation methods.  The minimum height setting is available to help when defining sea coasts and other areas of water.  For example, to define an island draw the appropriate contour lines and spot heights for the island and an area of sea at zero height for two or more sample points around the coast before applying interpolation.

Trend Analysis.  Used by Trend Analysis interpolation.  Defaults to ON.  Applies a trend analysis to the whole grid to fill in any undefined points.

Smoothing Transform.  Used by Trend Analysis interpolation.  Defaults to ON.  Applies a smoothing algorithm to the whole grid to correct any anomalous points.

Interpolation Considerations

The proportion of defined to undefined sample points required depends on the kind of landscape being defined.  For smooth, rounded hills or plains reasonable results may be obtained with 1 point in 40 or less.  For more complex structures 1 in 20 or less is recommended.  Interpolation is most accurate where the surface has few discontinuities - so for a valley with steep sides and a flat bottom placing defined points along the sides will be sufficient to derive the shape of the sides.  However, without further information the interpolation function will assume a continuation of the sides to form an over-deepened 'V', so you will need to define some of the valley floor.

In some circumstances the nearest neighbour interpolation algorithm will be unable to proceed and an error message will be displayed: for example if the height to width ration of the selected area is too extreme.  Re-select and try again.

nngridr and Calculation Efficiency

The implementation of  the nearest neighbour algorithm used in Visual Terrain was developed by Dave Watson (contact PO Box 734 Claremont, WA 6010, Australia). This is probably one of the most effective algorithms of it's type available.

However, although yielding excellent results, the time required to calculate interpolated values varies approximately with the square of the number of points.  We found that in practice on a Pentium-90 an area of up to about 10,000 points could be calculated with a delay of only a few minutes, and calculations on up to 160,000 points or more are certainly feasible if you are willing to allow for the time required.  Calculation times can be improved by dividing a large area into several smaller ones and interpolating in a stepwise manner, but in practise this is not recommended as artefacts may be produced around the edges of these areas (although these can be minimised by ensuring a good overlap).


Exporting Data

After you have defined a map you may wish to view it using a different viewing program.  Visual Terrain export the data constituting the map .lem file in a number of different formats.

All export functions are accessed by selecting the Export... item from the Tools menu.  Select the export file type required from drop down list box in the Save As dialog, and enter the file name.  With the exception of VRML export, no further parameters are  required.

ASCII

Exports all heights in space delimited ASCII format.  This is the same format as described in the Import ASCII function.

No information about terrains is exported.

AutoCAD DXF

Creates an AutoCAD compatible DXF file containing information about the landscape grid.  The grid defined as a simple 3DMESH entity type and no header or other parameter information is exported.  The file can be read by AutoCAD release 12 and should also be importable by other CAD programs, although no guarantee of compatibility is extended to these.

No information about terrains is exported.

Windows Bitmap BMP

Exports the map heights as a grey bitmap image.  Import of BMP files is supported by several other graphics programs, such as Bryce2.  However where possible Pixel Greymap images (PGM) should be used as unlike BMP files are not quantized to height 256 levels.

Pixel Greymap PGM

The PGM format is a simple graphics file format for grey images.  It is mainly found on UNIX systems, but is understood by some PC graphics packages such as Paintshop Pro.  PGM is included here as it offers some advantages over the Windows BMP format - firstly colours are not quantized and any number of grey shades can be supported, and secondly the file format is a simple ASCII text file and creating a macro interface to other programs for import is relatively straightforward.

No information about terrains is exported.

NTF Panorama

Creates a UK Ordnance Survey NTF Panorama file.  Note that the grid size of these it rigorously defined as a 401 square grid of 50 metre point spacing, and although Visual Terrain will export differently sized maps, these will be adjusted to fit the standard size.

No information about terrains is exported.

Triangle Mesh Surface - TIN

TIN files are used by some programs such as ArcInfo to describe an irregular triangle surface mesh.  The TIN export use the same Polygon Optimisation Dialog as VRML, but with texture mapping and background colour parameters disabled.

Vistapro DEM

Creates a Vistapro 3 compatible DEM.  Vistapro is limited to certain pre-defined grid sizes.  All of these are square, with a 30 metre grid point spacing.  The smallest (and commonest) size is 258 x 258, which is the largest grid size Visual Terrain supports, although it will import smaller sizes setting undefined points to zero.

No information about terrains is exported.

VRML

Exports the data in VRML 2.0 (Virtual Reality Modelling Language) format for viewing with a WWW browser such as Netscape.  Unlike all the other export types discussed here, VRML export uses a set of parameters to control how the model will appear, and a dialog box is displayed to set these before the map is exported.

VRML worlds are viewed in real-time, i.e. the viewer may move around inside the VRML model using the mouse.  If response times are to be acceptable on a medium specification PC (say a 100MHz Pentium) then the number of polygons in the image must be reduced to around 500 or less.  If this is not done, and the program exported a typical Visual Explorer map of 200 x 200 grid points then the 40,000 polygons that  the world contained would bring even a high specification machine to a virtual halt!

Visual Explorer employs an advanced polygon reduction algorithm to determine the best set of triangles that can model the map and minimise loss of detail.  You can control this using the Tolerance and Polygons parameters.  You may like to experiment with these, but in most cases a tolerance setting of 10 and about 300 to 500 polygons yield good results.

The VRML file is exported to show the surface texture mapped (i.e. in Visual Explorer terms with an overlay).  The required graphics file should be entered in the texture map edit control.  As the VRML file may be used on UNIX or other non-PC systems no validation of the file name is applied.  You can use maps or satellite images as texture maps, or if these are not suitable good results can be produced using an internal overlay file generated by Visual Animator.

The Background colour control sets the background colour for the world - for instance a sky blue.

VRML 2.0 is a comprehensive graphics description language and is supports many more features than those that can be set here (such as graduated backgrounds, fog, text etc.).  As VRML files are in ASCII text you can add these manually or using a specialised VRML design tool.  Further details about VRML may be found on the internet at http://vrml.vag.org.

XYZ Attribute

Exports all the data in the map in XYZ attribute format.  This format exports details of terrains in addition to heights.


Creating Actors

Introduction

Visual Explorer comes supplied with a large number of sample Actor files.  The objects are constructed from simple shapes such as cubes, cylinders etc. using a modified subset of the Persistence of Vision (POV) object description language.

Actor  files are identified by the .pov extension and are created with a simple editor such as Windows Notepad.  Some  programs that create POV objects may also create  files in suitable format for Visual Explorer - for example the Trees program included on the CD-ROM.

The Visual Actor program included on the CD-ROM may be used to preview Actors.

Language Description

The following gives a brief overview of supported statements, with examples.  Statements should be arranged one per line and are case sensitive.  Statements not included here are not supported.

The convention used here is that italics represent a item to be supplied by the user.  Thus ident represents a variable identifier, and 0.00 similarly indicates a user-supplied number.  The convention <x,y,z> represents a 3 dimensional x, y, z point co-ordinate.  All numbers are processed to approximately five decimal places.

// comment line

All text after a // is considered to be a comment.

#declare ident = colour red <0.00> green <0.00> blue <0.00>

Declares a colour value.  The numbers should be in the range 0 to 1.00.

#declare size { <0,0,0>, <0,0,0>}

Non-POV extension.  This is used to declare sizing information to Visual Explorer where the two sets of x, y, z values enclose a box.  This statement is not required, but if it is omitted Visual Explorer will derive the necessary information from the object co-ordinate statements.  In most circumstances this is fine, but problems may arise if an object such as a sphere has an edge outside this boundary as this will not be considered by Visual Animator when re-sizing the actor for placement in the landscape.

box { <0,0,0>, <,0,0> pigment  { color ident } rotate <0,0,0> }

Describes a box bounded by the two points <left, bottom, front> and <right, top, back>.  The box is rotated by the angles associated with the rotate keyword.  The colour identifier should refer to a colour define by a #declare statement.

cone { <0,0,0>, 0.0 <0,0,0>, 0.0 pigment { color ident } }

Draws a cone.  The first point co-ordinate describes the centre of the base and the following value the radius.  The final point is the apex of the cone.

cylinder {<0,0,0>, <0,0,0>, 0.0 pigment { color ident } }

Defines a cylinder.  The two points define the centre of the two end faces and the following value is the radius.

sphere { <0,0,0>, 0.0 pigment { color ident } }

Defines a sphere.  The point defines the centre of the sphere and the following value the radius.

triangle {<0,0,0>, <0,0,0>, <0,0,0>, pigment { color ident } }

Defines a triangle with corners at the three given co-ordinates.

OpenGL

Visual Animator uses the Windows OpenGL libraries to draw actors, and can therefore use hardware acceleration if your video card supports it.

OpenGL is included in Windows NT version 3.5 and later.  It is not included in Windows95, but the necessary extensions (dll files) are available from Microsoft and are also included with the Visual Explorer installation.  These dlls implement OpenGL in software.  If you already have, or subsequently install, a video card that implements OpenGL in hardware you should ensure that the manufacturers versions of opengl32.dll and glu32.dll are used.


Interfacing to other programs

Introduction

Visual Explorer is designed to be an open program which can be interfaced to other programs, usually by the XYZ file format. However the simplest way to obtain a sample x, y, z  file to experiment with is to export a sample map in this fromat from Visual Terrain.

The cdrom contains a demonstration version of DTM, a MapBasic program which simplifies the use of digital terrain model data with MapInfo.  Functions are provided to

•	Import gridded DTM data from ASCII source files

•	Thematically shade the DTM

•	Export digitised contours for use in gridding software

•	Export a DTM and attribute data for visualization in Vistapro and Visual Explorer.

DTM is a third party product, and a full manual is included on the cdrom in Word 6 format.  For more information contact

Integrated Mapping

PO Box 2708, Christchurch

New Zealand

Tel. 03 366  5234.  Fax. 03 365 5755

Email. Info@inmap.co.nz


The XYZ File Format

All records are comma delimited with the co-ordinate system origin in the SW corner.

Attribute refers to the terrain square to the NE of co-ordinate.  User defined  terrain colours and descriptions import is included as this information is easily available from MapInfo and maintains consistency across applications.  However, inclusion is not are obligatory.

RECORD 1

Header record.  Measurement System (m|i),min x, min y, max x, max y, x spacing, y spacing, attributes included (attr|noattr)

RECORD 2

Description.  Free format.

RECORD 3

Number of user-colours defined (nominally n, max 16, may be 0).

RECORDS 4 to 4+N

Terrain number, colour definition (RGB format - Red + 256 * Green + 65536 * Blue), terrain description (max 24 characters).

RECORDS 4+N+1 TO END OF FILE

Data.  X co-ordinate, Y co-ordinate, Height, Terrain type.

Example

m,0,0,8940,8940,60,60,attr

Exported from Visual Explorer

3

1,12582912,BdU

2,2292804,BnH

3,65535,BnR

0,0,2475.0,A

60,0,2460.0,A

120,0,2445.0,A

180,0,2430.0,A

240,0,2423.0,A

4140,0,2406.0,A

4200,0,2407.0,A

4260,0,2407.0,A

4320,0,2408.0,A

4380,0,2408.0,A

4440,0,2409.0,A

4500,0,2409.0,A

4560,0,2409.0,A

8880,0,1799.0,A

8940,0,1799.0,A

0,60,2464.0,A

60,60,2455.0,A

120,60,2437.0,A

180,60,2424.0,A

240,60,2414.0,A