Reference Guide > M–N Routines > MESH Function
  

MESH Function
Defines a polygonal mesh object that can be used by the RENDER function.
Usage
result = MESH(vertex_list, polygon_list)
Input Parameters
vertex_listA double-precision floating-point array of 3D points; the array's size is 3 * number_of_vertices.
polygon_list—A longword integer 1D array defining the polygons; the array's size is number_of_polygons * number_of_edges.
For more information on these two parameters, see the PV‑WAVE User’s Guide.
Returned Value
resultA structure that defines an object consisting of multiple polygons.
Keywords
ColorA 256-element double-precision floating-point vector containing the color (intensity) coefficients of the object. The default is Color(*)=1.0. For more information, see the PV‑WAVE User’s Guide.
KambA 256-element double-precision floating-point vector containing the ambient (flat shaded) coefficients. The default is Kamb(*)=0.0. For more information, see the PV‑WAVE User’s Guide.
KdiffA 256-element double-precision floating-point vector containing the diffuse reflectance coefficients. The default is Kdiff(*)=1.0. For more information, see the PV‑WAVE User’s Guide.
KtranA 256-element double-precision floating-point vector containing the specular transmission coefficients. The default is Ktran(*)=0.0. For more information, see the PV‑WAVE User’s Guide.
MaterialsA byte array of size number_of_polygons defining the materials list. The purpose of this keyword is similar to that of the Decal keyword for quadric objects. Its use permits the specification of properties for each polygon where each polygon specifies an index into the Color, Kamb, Kdiff, and Ktran property arrays.
For more information, see the PV‑WAVE User’s Guide.
TransformA 4-by-4 double-precision floating-point array containing the local transformation matrix whose default is the identity matrix. For more information, see the PV‑WAVE User’s Guide.
Discussion
MESH can be used by the RENDER function to render collections of 3D polygons, such as iso-surfaces, or spatial-structural data.
 
note
Any non-coplanar polygons in a mesh are automatically reduced to triangles by RENDER.
The Transform keyword can be specified to alter the scaling, as well as the orientation and position of the polygons defined by MESH.
Examples
vertices = [[-1.0, -1.0, 1.0],$
           [-1.0,  1.0,  1.0],$
           [ 1.0, 1.0, 1.0],$
           [ 1.0, -1.0, 1.0],$
           [-1.0, -1.0, -1.0],$
           [-1.0, 1.0, -1.0],$
           [ 1.0, 1.0, -1.0],$
           [ 1.0, -1.0, -1.0]]
polygons = [4, 0, 1, 2, 3,$
            4, 4, 5, 1, 0,$
            4, 2, 1, 5, 6,$
            4, 2, 6, 7, 3,$
            4, 0, 3, 7, 4,$
            4, 7, 6, 5, 4]
T3D, /Reset, Rotate=[15, 30, 45]
cube = MESH(vertices, polygons, Transform=!P.T)
WINDOW, Xsize=256, Ysize=256
TV, RENDER(cube)
See Also
CONE,   CYLINDER,   RENDER,   SPHERE, VOLUME
For more information, see the PV‑WAVE User’s Guide.

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