PSGMESH

Mesh Perspective Scene Generation


EnvironmentsPYTHON :: EASI :: MODELER
Batch ModeYes
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Related

Back to top

Description


Generates a three dimensional wire mesh rendering using elevation data, and optionally drapes vectors over the mesh.
Note:
Back to top

Parameters


Name Type Length Value range
Input Elevation: Input elevation layer * Raster port 1 - 1  
InputVec: Input vector layer(s) Vector port 0 - 6  
OutputPSG: Output perspective scene layers * Raster port 1 - 3  
Elevation Float 0 - 2 scale, offset
Default: 1,0
Background Color Integer 0 - 3 0,0,0 - 255,255,255
Default: 0,0,0
Mesh Color Integer 0 - 3 0,0,0 - 255,255,255
Default: 128,128,128
Mesh Spacing: X Direction Int x >= 0 - 1024  
Mesh Spacing: Y Direction Int x >= 0 - 1024  
Viewpoint Integer 0 - 1024 0 &= x &= 8192
Default: 
Height above sea level Integer 0 - 1024 x &= x -1000.0
Default: 
Height above surface Integer 0 - 1024 x &= x -0.0
Default: 
Field of View Float 0 - 1 0 - 170
Default: 0
View Direction Real 0 - 2 0,0 - 360
Default: 180
View Inclination Real 0 - 2 0,0 - 90.0
Default: 30.0
Number of Front Pixels * Float 1 - 1 1 -
InputVector: Input vector segment(s) Raster port 0 - 6 0,0,0,0,0,0 -

* Required parameter
Back to top

Parameter descriptions

Input Elevation: Input elevation layer

Specifies the input layer or channel that contains the elevation data.

InputVec: Input vector layer(s)

Specifies the input layer(s) consisting of sets of vectors (type VEC:116) that will be draped on the generated perspective output. Up to 6 sets of vectors can be connected.

OutputPSG: Output perspective scene layers

Specifies the output layer(s) that will contain the generated perspective scene.

If a single layer is specified, output is BW (black and white).

If three layers are specified, output is RGB (red, green, blue).

Elevation

Optionally specifies the scale and offset to apply to the elevation values in the elevation channel (DBEC) to convert values to meters.

If unspecified, scale defaults to 1, and offset defaults to 0.

The equation for the conversion is:

elevation in meters = scale * (value + offset)

For example, to convert elevation values from feet to meters, where a value of 0 represents 1000 feet:

0.3048,1000        : meters = 0.3048 * (value + 1000)

Notes:

It is possible to exaggerate the effect of elevation by using a larger scale value.

It is critical that the ground size of pixels be properly set. This is done when the file is created (for example, CIM function); alternatively, it can be set directly using the APS function.

Background Color

Specifies the background (sky) color for the generated perspective scene.

Each background color is in the range of 0-255.

A color can be specified for each channel in the output scene. If no colors are specified, the default is 0. If only one color is specified, that color is used for all other unspecified channels. If more colors are specified than there are channels in the output file, only as many colors as channels are used.

Background color is typically set to 0,0,0 (black), or variations of light blue (for example, 0,160,255) to simulate the sky.

Mesh Color

Specifies the color used to draw the generated mesh.

Mesh colors are in the range of 0-255. If no color is specified, the mesh color is generated based on the elevation.

A color can be specified for each channel in the output scene. If only one color is specified, that color is used for all other unspecified channels. If more colors are specified than there are channels in the output file, only as many colors as channels are used.

Mesh Spacing: X Direction

Specifies the spacing, in pixels, of the mesh in the X direction.

This spacing is applied to the input data.

Mesh Spacing: Y Direction

Specifies the spacing, in pixels, of the mesh in the Y direction.

This spacing is applied to the input data. If not specified, Y spacing defaults to the X spacing.

Viewpoint

Specifies the pixel (X) and line (Y) coordinates for the viewing position of the observer.

Height above sea level

Specifies the height (Zpos) of the observer's viewing position, in meters above sea level.

Note: If Zrel is specified, Zpos is ignored; otherwise Zpos is used.

Height above surface

Specifies the height (Zrel) of the observer's viewing position, in meters above the surface at Xpos,Ypos.

Note: If Zpos is specified, Zrel is ignored.

Field of View

Specifies the angle of the field of view (viewing cone) in the scene, in degrees from 0 to 170.

The field of view is comparable to camera focal length in photogrammetry; it defines the perspective for the generated scene.

For example:

To specify a value, type into the field, or select one of the pre-set angles.

View Direction

Specifies the angle for the viewing direction.

The direction angle is expressed in degrees from 0 to 360. A value of 0 provides a view from bottom of the image towards the top; a value of 270 provides a view from the right of the image looking left. THe default value is 180.

To specify a value, type into the field, or select one of the pre-set angles.

View Inclination

Specifies the angle for the viewing inclination.

The inclination value is expressed in degrees from 0 to 90 and specifies the angle for tilting the earth. This is useful for viewing objects positioned behind others, and provides a greater feeling of depth. A value of 0 provides a profile, 90 offers a straight-down view, and 30 provides a 'human eye' view. The default value is 30.

To specify a value, type into the field, or select one of the pre-set angles.

Number of Front Pixels

Specifies the number of foreground pixels that are represented across the front of the output window.

Note: If the viewpoint of the perspective scene is high above ground level, the foreground may appear to have many more pixels than specified by this parameter, due to perspective. Using a very small or very large value may generate a poor result.

InputVector: Input vector segment(s)

Specifies the name of the file that contains the input vector segments to be draped on the generated perspective. The input vector segment consists of sets of vectors (type VEC:116); up to 6 sets of vectors can be connected.

Vector sets are colored: red, green, blue, yellow, black, white. In BW perspectives, all vectors are colored white (except black).

Vectors typically represent elements such as roads, rivers and streams, contours, etc.

Vectors are always drawn 1 pixel wide, regardless of the perspective or foreground zooming.

Back to top

Details

PSGMESH generates a three dimensional wire mesh rendering using elevation data, and optionally drapes vectors over the mesh.

Most imagery, at least in remote sensing applications, is taken from high altitudes looking straight down. It is occasionally useful, however, to simulate the view an observer would have if he were standing on the ground looking out over the image at an oblique angle. This is generally known as "Perspective Scene Generation" and requires that elevation data be available for each pixel in the input imagery.

PSGMESH generates the perspective scene using a mesh (or wire model), rather than using solids like the functions PSG and PSGIMAG.

The InputElevation, and InputVec ports specify where the input imagery and elevation data are obtained.

The parameter ESCALE (Elevation) describes how to convert the elevation values in the input channel into meters.

The OutputPSG (Perspective Scene Layers) port defines the output for the generated perspective scene.

The BACKCOL (Background Color) parameter specifies how to color the background of the output scene for better effect.

The MESHCOL (Mesh Color) describes how to color the generated mesh. If the user specifies a color, the entire mesh is drawn using the specified single color. If no color values are specified, PSGMESH automatically generates colors for the mesh based on the input elevation. For color perspectives, generated colors vary smoothly from blue (low elevation), through green and yellow, to red (highest elevation). For black and white perspectives, colors vary from black (low elevation) through shades of gray, to white (high elevation).

The parameter MESHSPAC (Mesh Spacing, X and Y directions) specifies the spacing, in pixels, to use when generating the mesh.

The parameters VPOINT (Viewpoint), VFIELD (Height Above Sea Level, Height Above Surface, Field of View), and VANGLE (View Direction, View Inclination) describe the imaginary observer's point of view.

The FRONTPIX (Number of Front Pixels) parameter specifies the number of pixels that should be represented across the front of the rendered output window.

The parameter DBVS optionally specifies sets of vectors, held in vector segments, to drape over the rendered perspective. Vectors are drawn 1 pixel wide, regardless of distance or perspective. The first set of vectors is always drawn in red, the second in green, third in blue, fourth in yellow, fifth in black, and sixth in white. Because vector segments can be duplicated in DBVS, a specific color can be obtained by specifying a particular segment multiple times. For example, if segment 26 contains rivers and streams, these could be shown in blue by specifying as three 26 segment vectors.

PSGMESH will write segment 26 in red, then in green, and then in blue. Because blue was written last, only blue would be visible. Keep this overlapping feature in mind when you display these channels. The most important vector should be listed last so that it is not overlapped and hidden by other vector data.

If a single channel perspective (B&W) is being generated, all vectors are drawn in white except the fifth set, which is drawn in black.

The many parameters in PSGMESH, combined with the concepts of perspective geometry, angles and position can make PSGMESH initially difficult to use. Sketching out the extent of the database and carefully determining the view point (VPOINT) and viewing angles (VANGLE) can make PSGMESH much simpler to understand.

Memory usage

PSGMESH is CPU- and memory-intensive.

Memory is allocated dynamically, depending on the dimensions of the input data and the output scene generated. Using very large data sets can easily overload the available RAM on the host computer system, which can result in extremely poor performance or even function failure.

The amount of RAM required can be calculated as the sum of a through c, as shown below:

a) to hold input imagery = 4 * fileXsize * fileYsize

b) to hold output scene = 7 * DBOW(3) * DBOW(4)

c) to hold the largest (optional) vector segment (sizes here can be difficult to determine)

Input Elevation   Output Scene    Vectors    Total RAM Used

4*( 512* 512)  +  7*( 512* 512)  + 1Mbyte   =    3.75 Mbytes
4*(1024*1024)  +  7*( 512* 512)  + 1Mbyte   =    6.75 Mbytes
4*(2048*2048)  +  7*( 512* 512)  + 1Mbyte   =   18.75 Mbytes
4*(4096*4096)  +  7*(1024*2048)  + 1Mbyte   =   79.00 Mbytes

Camera notes

This section provides background information about the camera model used to generate the perspective.

The view point (VPOINT) used in PSGMESH is not the actual eye point, but the center of the bottom edge of the camera image plane. The actual eye point is some distance behind the camera image plane. This distance is determined by a calculation based on the field of view (VFIELD) and the number of foreground pixels (FRONTPIX).

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.