Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ spline_cone(3G) — PersonalVisualizer 2.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

arc(3G)

curve_resolution(3G)

trimming_curve(3G)

vertex_format(3G)

spline_cone(3G)

NAME

spline_cone − draw a cone using a spline surface

SYNOPSIS

C Syntax:

void spline_cone(fildes,l_rad,u_rad,height,x,y,z,
dirx,diry,dirz,refx,refy,refz);
int fildes;
float l_rad,u_rad,height,x,y,z,dirx,diry,dirz,
refx,refy,refz;

FORTRAN77 Syntax:

subroutine spline_cone(fildes,l_rad,u_rad,height,x,y,z,
dirx,diry,dirz,refx,refy,refz)
integer*4 fildes
real l_rad,u_rad,height,x,y,z,dirx,diry,dirz,
refx,refy,refz

Pascal Syntax:

procedure spline_cone(fildes:integer;l_rad,u_rad,height,
x,y,z,dirx,diry,dirz,refx,refy,refz:real);

DESCRIPTION

Input Parameters

fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened. 

l_rad Radius of the lower edge of the cone. 

u_rad Radius of the upper edge of the cone. 

height Height of the cone. 

x,y,z Position of the center of the cone’s lower edge in modelling coordinates. 

dirx,diry,dirz Defines the direction vector, anchored at (x,y,z), of the cone’s central axis. 

refx,refy,refz Defines a direction that determines the (u,v) origin of the cone’s spline surface. 

Discussion

spline_cone draws a cone-shaped rational spline surface at the specified coordinates. 

The cone is drawn with a lower edge of radius l_rad centered about the point (x,y,z).  The cone’s central axis runs from (x,y,z) in the direction defined by the vector (dirx,diry,dirz). 

The upper edge of the cone is drawn a distance of height along the central axis from (x,y,z) and has a radius of u_rad.  Both the upper and lower edges of the cone are perpendicular to the central axis. 

To make a cone which comes to a point at the top, set u_rad equal to zero. 

To make a cylinder, set u_rad and l_rad to equal values. 

Cones produced by this function do not have top and bottom faces (caps).  These faces must be drawn separately, either with arc functions or by drawing “washers” with spline_cone.  A “washer” is defined as the area between two concentric circles in a plane.  To make a washer with spline_cone, set height to 0.0.  Set u_rad to 0.0 as well to create a washer that can be used as a face for a cone.  A washer cannot be made with l_rad equal to u_rad. 

spline_cone converts the cone specification parameters into a 9×2 (quadratic,linear) control-point matrix that defines a four-patch (4×1) spline surface.  The (u,v) origin and the orientation of this spline surface are determined by the reference vector (refx,refy,refz).  This reference vector need not be normalized to unit length, and need not be perpendicular to the central axis.  The point on the lower edge of the cone that is closest to (refx,refy,refz) is the (u,v) origin.  The v axis proceeds from the (u,v) origin, where v=0.0, to the point on the upper edge of the cone that is closest to the reference point, where v=1.0. The u axis maps in a right-hand fashion around the cone edges, originating at the v axis where u=0.0 and proceeding to u=1.0.

In cases where the precise orientation of the (u,v) space does not matter, (if trimming curves are not used, for example), (refx,refy,refz) can be arbitrarily set.  For fastest performance, set (refx,refy,refz) to (0.0,0.0,0.0). 

If (refx,refy,refz) is set either to (0.0,0.0,0.0) or is parallel to the central axis, and trim curves are used, a reference direction of (1.0,0.0,0.0) is used relative to a central axis direction of (0.0,0.0,1.0).  The transformation from (0.0,0.0,1.0) to the defined central axis also transforms the default reference point to its new orientation. 

Because the cone is rendered as a spline surface, it is subject to all conditions set by the user with functions such as vertex_format, curve_resolution, trimming_curve, etc.  A vertex_format of CLOCKWISE (0) is used to display the outside of the surface, while COUNTER_CLOCKWISE (1) displays the inner surface.  When a CLOCKWISE vertex format is used, washers created with this function face toward the axis direction so long as l_rad is greater than u_rad; otherwise they face away.  spline_cone sets its own u and v knot vectors, ignoring any existing Starbase knot vectors.  Existing Starbase knot vectors are saved when spline_cone is called and then restored after the call. 

NOTES

This primitive command can be used with all global and non-global rendering modes. 

Starbase texture mapping may be applied to spline cones.  The mapping of textures onto the cone is determined by the (u,v) mapping of the spline surface on the cone. 

The Starbase ray tracer is optimized for the smooth shaded cone, as it uses the algebraic form to render the object.  A cone which is passed to the ray tracer without smooth shading (no normals per vertex), will be treated by the ray tracer as an ordinary spline surface, which requires a slower and more memory-intensive rendering. 

ERRORS

Invalid file descriptor. 
l_rad less than 0.0. 
u_rad less than 0.0. 
l_rad and u_rad both equal to 0.0. 
height less than 0.0. 
height equal to 0.0 and l_rad equal to u_rad. 
dirx, diry, and dirz all equal to 0.0. 

SEE ALSO

arc(3G), curve_resolution(3G), trimming_curve(3G), vertex_format(3G), Starbase Graphics Techniques.

  —  July 12, 1991

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026