
| Graph axis blend color color bar fog freetype light line material node point plot polygon render scene stencil texcoord text texture vertex Utility array bio hdf make math netcdf Auxiliary curl expact sqlite window |
Make PackageFunctions for shape creation: fan, disk, cylinder, sphere, sphere2, shell, toroid, extrude, sweep, tween, contour3, contour4, isosurf, delaunay, field, grid2points, grid2quads, grid2cube, data2color, normal2, normal3, normal4, sort. .fan(arr, radius, slices, start_angle, sweep_angle) The function creates GL_TRIANGLE_FAN vertices and texture coordinates and saves the results in the double type array arr. The first three vectors of arr contain vertices and the next two vectors contain texture coordinates. The texture coordinate at the fan center is (0.5, 0) and those along the fan edge are from (0, 1) to (1, 1). For use in a 3D scene, you should assign one normal pointing to the z-direction to the shape..disk(arr, inner_radius, outer_radius, slices, start_angle, sweep_angle) The function creates GL_QUAD_STRIP vertices and texture coordinates and saves the results in the double type array arr. The first three vectors of arr contain vertices and the next two contain texture coordinates. The texture coordinates along the inner edge vary from (0, 0) to (1, 0) and those along the outer edge from (0, 1) to (1, 1). For use in a 3D scene, you should assign one normal pointing to the z-direction to the shape. .cylinder(arr, base_radius, top_radius, slices, start_angle, sweep_angle) The function creates GL_QUAD_STRIP vertices, normals, and texture coordinates and saves the results in the double type array arr. The first three vectors of arr contain vertices, the next three contain normal, and the last two contain texture coordinates. The texture coordinates along the base edge vary from (0, 0) to (1, 0) and those along the top edge from (0, 1) to (1, 1). .sphere(arr, radius, iterations) The function creates GL_TRIANGLES vertices and their normal that can be used as the surface of a sphere The first three vectors of arr contain vertices and the next three contain vertex normal. A vertex normal points outward. .sphere2(arr, radius, iterations) The function calls shell() function 8 times to creates GL_TRIANGLES vertices, normal, and texture coordinates that can be used to form sphere surface. It saves the results in the double type array arr. The first three vectors of arr contain vertices, the next three contain vertex normal, and the last two contains texture coordinates. A vertex normal points outward. .shell(arr, radius, iteration, index) The function creates GL_TRIANGLES vertices, normal, and texture coordinates that can be used as 1/8 of a sphere surface. It saves the results in the double type array arr. The first three vectors of arr contain vertices, the next three contain normal, and the last two contain texture coordinates. A vertex normal points outward. A phase index of 1 to 8 corresponds to eight x-y-z phases of (1, 1, 1), (-1, 1, 1), (-1, -1, 1), (1, -1, 1), (1, 1, -1), (-1, 1, -1), (-1, -1, -1), and (1, -1, -1). The corresponding texture coordinates of those phases are {(0, 0.5), (0.25, 1)}, {(0.25, 0.5), (0.5, 1)}, {(0.5, 0.5), (0.75, 1)}, {(0.75, 0.5), (1, 1)}, {(0, 0), (0.25, 0.5)}, {(0.25, 0), (0.5, 0.5)}, {(0.5, 0), (0.75, 0.5)}, {(0.75, 0), (1, 0.5)}, respectively. .toroid(arr, torus_radius, ring_radius, start_angle, sweep_angle, slices) The function creates GL_QUAD_STRIP vertices, normal, and texture coordinates that can be used form a torus. It saves the results in the double type array arr. The first three vectors of arr contain vertices, the next three contain normal, and the last two contain texture coordinates. A vertex normal points outward. The texture s-coordinates of 0 and 1 correspond to angles of 0 to 360 degree; and t-coordinates of 0 and 1 correspond to the cross section from outer, to top, to inner and then to bottom. The function creates GL_QUAD_STRIP vertices, normal, and texture by extruding the curve (double type array) in the z-axis direction. It saves the results in the double type array arr. The first three vectors of arr contain vertices, the next three contain normal, and the last two contain texture coordinates. The normal direction depends on directions of curve segments. The texture coordinate of the first vertex of the curve is (0, 0) and that of the last vertex is (1, 0). The texture coordinate of the first vertex of the extruded curve is (0, 1) and that of the last vertex is (1, 1). The function creates GL_QUAD_STRIP vertices, normal, and texture by sweeping the curve (double type array) around the z-axis. It saves the results in the double type array arr. The first three vectors of arr contain vertices, the next three contain normal, and the last two contain texture coordinates. The normal points outward if the angle is positive; otherwise points inward. The texture coordinate of the first vertex of the curve is (0, 0) and that of the last vertex is (0, 1). The texture coordinate of the first vertex of the sweeped curve is (1, 0) and that of the last vertex is (1, 1). The function creates GL_QUAD_STRIP vertices, normal, and texture by connecting the two curves (double type arrays). It saves the results in the double type array arr. The first three vectors of arr contain vertices, the next three contain normal, and the last two contain texture coordinates. The texture coordinate of the first vertex of the curve is (0, 0) and that of the last vertex is (0, 1). .contour3(arr, iso, fill, xyz) The function creates GL_LINES (fill = 0) or GL_TRINAGLES (fill != 0) vertices resulted from contouring trianges in the double type array xyz for the given contour value. It saves the results in the double type array arr. .contour4(arr, iso, fill, xyz) The function creates GL_LINES (fill = 0) or GL_TRINAGLES (fill != 0) vertices resulted from contouring quads in the double type array xyz for the given contour value. It saves the results in the double type array arr. The function creates GL_TRIANGLES vertices and normal resulted from marching cube volume-rendering algorithm. It saves the results in the double type array arr. The volume data (in the double type array vol) at the eight points of a 3D grid should be counted anti-clockwise first for the bottom plane and then for the top plane. The iso-surface encloses vertices with values higher than the iso-value. The first three vectors of arr contain vertex outputs and the next three contain normal outputs. The function creates GL_TRIANGLES vertices using the Denaulay triangulation method on data in the double type array xyz and saves the results in the double type array arr. The function creates GL_LINES vertices that comprise arrows of wind field and saves the results in the double type array arr. The first two vectors of xyuv should contain x- and y-values of positions and the next two contain u- and v-winds. Converts regular grid data in the double type array xyz to the double type array arr that can be used by the vertex object of a point object. The x and y of the ouput array are the vector and record indices, respectively, multiplied by the scale factor. The z ouputs are zero. Converts regular grid data in the double type array xyz to the double type array arr that can be used by the vertex object of a polygon object of GL_QUADS. The x and y of the ouput array are the vector and record indices, respectively, multiplied by the scale factor. The z outputs are zero. .grid2cube(arr, scale, gr1, gr2) Converts two layers of regular grid data in the double type arrays gr1 and gr2 to the double type array arr that can be used by the iso-surface function. The x and y of the ouput array are the vector and record indices, respectively, multiplied by the scale factor. The z outputs are the same as the scale. Calculates colors for the data in the double type array dat (n by 1) using the color table in the double type array ctb (m by 3) and saves the results in the double type array arr. .normal2(x0, y0, z0, x1, y1, z1, x2, y2, z2) Calculates the normal vector of the plane formed by vectors of (x1, y1, z1) - (x0, y0, z0) and (x2, y2, z2) - (x0, y0, z0). Calculates per vertex normal for triangle vertex data in xyz (double type array) and saves the results in arr (double type array). The scale factor will be used to scale z-values in normal calculation. Calculates per vertex normal for quads vertex data in xyz (double type array) and saves the results in arr (double type array). The scale factor will be used to scale z-values in normal calculation.
|