User Guide > Rendering Techniques > Manipulating and Converting Data
  

Manipulating and Converting Data
PV‑WAVE provides routines for manipulating and converting data, as summarized in this section. This step is optional depending on the type of data you are using. For details about each routine, see its description in PV‑WAVE Reference.
2-, 3-, and 4-dimensional Gridding
Gridding is a method that generates a uniform grid from irregularly spaced data; the method interpolates or extrapolates new data from a given set of data, and then creates a uniform grid that maps this data. PV‑WAVE supports 2D, 3D, and 4D gridding.
2D Gridding
The functions FAST_GRID2 and GRID_2D return a gridded one-dimensional array containing Y values for input data with X, Y coordinates. The FAST_GRID2 function works best with dense data points (more than a thousand points to be gridded). The GRID_2D function works best with sparse data points (less than a thousand points to be gridded).
3D Gridding
The functions FAST_GRID3 and GRID_3D return a gridded two-dimensional array containing Z values for input data with X, Y, and Z coordinates. The FAST_GRID3 function works best with dense data points. The GRID_3D function works best with sparse data points.
4D Gridding
The functions FAST_GRID4 and GRID_4D return a gridded three-dimensional array containing intensity values for input data with four-dimensional coordinates. The FAST_GRID4 function works best with dense data points. The GRID_4D function works best with sparse data points.
Spherical Gridding
The GRID_SPHERE function returns a gridded, two-dimensional array containing radii, given random longitude, latitude, and radius values.
Polygon Manipulation
The polygon manipulation routines generate information to be used by the polygon rendering routines. These routines are discussed in detail in the PV‑WAVE Reference.
*POLY_C_CONV—This function returns a list of colors for each polygon. The function requires a polygon_list and a list of colors for each vertex. The POLY_PLOT procedure uses data generated by this function.
*POLY_COUNT—This function returns the total number of polygons contained in a polygon_list. The total number of polygons is required as an input by the POLY_PLOT procedure.
*POLY_MERGE—This procedure merges two vertex lists and two polygon lists.
*POLY_TRANS—This function returns a list of 3D points transformed by a 4-by-4 transformation matrix.
Volume Manipulation
The two volume manipulation routines, VOL_PAD and VOL_TRANS prepare volumes for rendering.
*VOL_PAD—This function returns a three-dimensional volume of data padded on all six sides with zeroes. For example, if you are transforming a small volume inside a large volume using the VOL_TRANS function, then you should use the VOL_PAD function to pad the small volume with zeros. If you do not pad the small volume with zeros, the data points at the edge of the small volume will be duplicated to fill the space between the outer surfaces of the small volume and the inner surfaces of the large volume. See Padded Volume. This function is often used to process volumes before using the VOL_TRANS and SLICE_VOL function.
 
Figure 7-3: Padded Volume
*VOL_TRANS—This function returns a three-dimensional volume of data transformed by a 4-by-4 matrix.
*SLICE_VOL—This function returns a two-dimensional array containing a slice from a three-dimensional volumetric array.
Coordinate Conversion
PV‑WAVE provides several routines for converting data to various coordinate systems. Some of the rendering functions require that data be mapped to a particular coordinate system. The POLY_PLOT procedure requires a vertex_list with device coordinates. The POLYSHADE procedure must be in either data or normalized coordinates.
*CONV_TO_RECT—This function converts polar, cylindrical, or spherical coordinates to rectangular coordinates.
*CONV_FROM_RECT—This function converts rectangular coordinates to polar, cylindrical, or spherical coordinates.
*POLY_NORM—This function returns a list of three-dimensional points converted from data coordinates to normal coordinates. This function is often used in conjunction with the POLY_TRANS and POLY_DEV functions to transform a vertex_list that is used by some of the render functions.
*POLY_TRANS—This function returns a list of three-dimensional points transformed by a 4-by-4 transformation matrix. Like the POLY_NORM function, this function is used to transform a vertex_list.
*POLY_DEV—This function returns a list of three-dimensional points converted from normal coordinates to device coordinates. This function is often used in conjunction with the POLY_TRANS and POLY_NORM functions to transform a vertex_list.

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.