spline(3G)
NAME
spline_curve2d, spline_curve3d, spline_surface − draw a spline curve or surface.
SYNOPSIS
C Syntax:
void spline_curve2d (fildes,plist,numpts,order,rational);
int fildes, numpts, order, rational;
float plist[];
void spline_curve3d (fildes,plist,numpts,order,rational);
int fildes, numpts, order, rational;
float plist[];
void spline_surface(fildes,plist,numpts_u,numpts_v,
order_u,order_v,rational);
int fildes, numpts_u, numpts_v, order_u, order_v,
float plist[];
FORTRAN77 Syntax:
subroutine spline_curve2d(fildes,plist,numpts,order,rational)
integer*4 fildes, numpts, order, rational
real plist (numpts*3)
subroutine spline_curve3d(fildes,plist,numpts,order,rational)
integer*4 fildes, numpts, order, rational
real plist (numpts*3)
subroutine spline_surface (fildes,plist,numpts_u,numpts_v,
order_u,order_v,rational)
integer*4 fildes, numpts_u, numpts_v, order_u, order_v,
real plist (numpts_u*numpts_v*3)
Pascal Syntax:
procedure spline_curve2d(fildes:integer;
var plist array [lo..hi:integer] of real;
numpts, order, rational:integer);
procedure spline_curve3d(fildes:integer;
var plist array [lo..hi:integer] of real;
numpts, order, rational:integer);
procedure spline_surface(fildes:integer;
var plist array[lo..hi:integer] of real;
numpts_u, numpts_v, order_u, order_v, rational:integer);
DESCRIPTION
Input Parameters
fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
numpts Number of points in the plist array
numpts_u,numpts_v Number of points along each axis in the plist array
plist Array of spline control points
order, order_u, order_v
spline curve or surface order:
LINEAR = 2, QUADRATIC = 3, CUBIC = 4, QUARTIC = 5,
QUINTIC = 6.
rational Specifies whether the spline is RATIONAL (1) or NONRATIONAL (0)
Discussion
spline_curve draws a spline curve of the specified order, using the points in the plist array as control points and the current interpolation matrices specified by the u knot vector. The curve is drawn using the current polyline attributes and the u_exterior curve_resolution
spline_surface draws a spline surface of the specified orders, using the points in the plist array as control points and the current interpolation matrices specified by the u and v knot vectors. Use curve_resolution to set the size of polylines or polygons that make up the curve or surface.
The data in the plist array is two dimensional coordinate data (x,y), or (x,y,h) for spline_curve2d, three dimensional (x,y,z) or (x,y,z,h) for spline_curve3d, and three dimensional (x,y,z) or (x,y,z,h) for spline_surface where h is the rational coordinate. The spline_surface data is ordered first along the u-axis and then along the v-axis; that is, the individual rows of the plist array are assumed to contain the data to be interpolated for a constant v value.
The current vertex_format affects spline surface generation. If coord = 3, use = 3, and rgb = FALSE (normals per vertex), spline surface generation generates normals per vertex and performs smooth (Gouraud) shading. Constant (faceted) shading is used for spline surfaces in all other cases. The direction of these normals is effected by the clockwise parameter of vertex_format. If counter clockwise polygons are specified then the normals are calculated as the u-derivative cross the v-derivative. If clockwise polygons are specified then the normals are calculated as the v-derivative cross the u-derivative. Spline surfaces also use the current interior_style, so interior_style must be set to INT_SOLID or INT_TEXTURE for any shading to occur. If the interior_style is set to INT_TEXTURE, then the mapping of the texture onto the spline surface is controlled by u and v knot vectors and the texture_viewport and texture_window procedures. This is done by using the associated (u,v) coordinate with each polygon vertex generated.
Surfaces that degenerate to a line or point are illegal if normals per vertex are specified in vertex_format.
SEE ALSO
curve_resolution(3G), define_texture(3G), interior_style(3G), knot_vectors(3G), texture_index(3G), texture_viewport(3G), texture_window(3G), trimming_curve(3G), vertex_format(3G), Starbase Graphics Techniques.
Hewlett-Packard Company — HP-UX Release 9.0: August 1992