Quadric surfaces are defined by quadratic equations in two dimensional space. Spheres and cones are examples of quadrics. The quadric surfaces of RenderMan are surfaces of revolution in which a finite curve in two dimensions is swept in three dimensional space about one axis to create a surface. A circle centered at the origin forms a sphere. If the circle is not centered at the origin, the circle sweeps out a torus. A line segment with one end lying on the axis of rotation forms a cone. A line segment parallel to the axis of rotation forms a cylinder. The generalization of a line segment creates a hyperboloid by rotating an arbitrary line segment in three dimensional space about the Z axis. The axis of rotation is always the z axis. Each quadric routine has a sweep parameter, specifying the angular extent to which the quadric is swept about z axis. Sweeping a quadric by less than 360 degrees leaves an open surface.

Many common shapes can be modeled with quadrics. Although it is possible to convert quadrics to patches, they are defined as primitives because special-purpose rendering programs render them directly and because their surface parameters are not necessarily preserved if they are converted to patches. Quadric primitives are particularly useful in solid and molecular modeling applications.

All the following quadrics are rotationally symmetric about the z axis. In all the quadrics *u* and *v*
are assumed to run from 0 to 1. These primitives all define a bounded
region on a quadric surface. It is not possible to define infinite quadrics.
Note that each quadric is defined relative to the origin of the object coordinate
system. To position them at another point or with their symmetry axis in
another direction requires the use a modeling transformation. The geometric normal
to the surface points ``outward'' from the z-axis, if the *current orientation*
matches the orientation of the *current transformation* and "inward"
if they don't match. The sense of a quadric can be reversed by giving
negative parameters. For example, giving a negative *thetamax* parameter
in any of the following definitions will turn the quadric inside-out.

Each quadric has a *parameterlist*. This is a list of token-array
pairs where each token is one of the standard geometric primitive variables or a variable
which has been defined with **RiDeclare**. Position variables
should not be given with quadrics. All angular arguments to these functions
are given in degrees. The trigonometric functions used in their definitions
are assumed to also accept angles in degrees.

RiSphere( radius, zmin, zmax, thetamax, parameterlist )RtFloatradius;RtFloatzmin, zmax;RtFloatthetamax;

Requests a sphere defined by the following equations:

Note that if zmin > -radius or zmax < radius, the bottom or top of the sphere is open, and that if thetamax is not equal to 360 degrees, the sides are also open.

RIB BINDINGSphereradius zmin zmax thetamax parameterlistSphere[radius zmin zmax thetamax] parameterlist EXAMPLERiSphere(0.5, 0.0, 0.5, 360.0, RI_NULL);

RiCone( height, radius, thetamax, parameterlist )RtFloatheight;RtFloatradius;RtFloatthetamax;

Requests a cone defined by the following equations:

Note that the bottom of the cone is open, and if *thetamax* is not
equal to 360 degrees, the sides are open.

RIB BINDINGConeheight radius thetamax parameterlistCone[height radius thetamax] parameterlist EXAMPLERtColorfour_colors[4];RiCone(0.5, 0.5, 270.0, "Cs", (RtPointer)four_colors, RI_NULL);

RiCylinder( radius, zmin, zmax, thetamax, parameterlist )RtFloatradius;RtFloatzmin, zmax;RtFloatthetamax;

Requests a cylinder defined by the following equations:

Note that the cylinder is open at the top and bottom, and if *thetamax*
is not equal to 360 degrees, the sides also are open.

RIB BINDINGCylinderradius zmin zmax thetamax parameterlistCylinder[radius zmin zmax thetamax] parameterlist EXAMPLECylinder.5 .2 1 360

RiHyperboloid( point1, point2, thetamax, parameterlist )RtPointpoint1, point2;RtFloatthetamax;

Requests a hyperboloid defined by the following equations:

assuming that point1 = (x1,y1, z1) and point2 = (x2, y2, z2).

The cone, disk and cylinder are special cases of this surface. Note that the top
and bottom of the hyperboloid are open when *point1* and *point2*, respectively,
are not on the z-axis. Also, if thetamax is not equal to 360 degrees, the
sides are open.

RIB BINDINGHyperboloidx1 y1 z1 x2 y2 z2 thetamax parameterlistHyperboloid[x1 y1 z1 x2 y2 z2 thetamax] parameterlist EXAMPLEHyperboloid0 0 0 .5 0 0 270 "Cs" [1 1 1 .5 .9 1 .2 .9 0 .5 .2 0]

RiParaboloid( rmax, zmin, zmax, thetamax, parameterlist )RtFloatrmax;RtFloatzmin, zmax;RtFloatthetamax;

Requests a paraboloid defined by the following equations:

Note that the top of the paraboloid is open, and if *thetamax* is not
equal to 360 degrees, the sides are also open.

RIB BINDINGParaboloidrmax zmin zmax thetamax parameterlistParaboloid[rmax zmin zmax thetamax] parameterlist EXAMPLEParaboloid.5 .2 .7 270

RiDisk( height, radius, thetamax, parameterlist )RtFloatheightRtFloatradius;RtFloatthetamax;

Requests a disk defined by the following equations:

Note that the surface normal of the disk points in the positive *z*
direction when *thetamax* is positive.

RIB BINDINGDiskheight radius thetamax parameterlistDisk[height radius thetamax] parameterlist EXAMPLERiDisk(1.0, 0.5, 270.0, RI_NULL);

RiTorus( majorradius, minorradius, phimin, phimax, thetamax, parameterlist )RtFloatmajorradius, minorradius;RtFloatphimin, phimax;RtFloatthetamax;

Requests a torus defined by the following equations:

Note that if *phimax-phimin* or *thetamax* is not equal to 360
degrees, the torus is open.

RIB BINDINGTorusrmajor rminor phimin phimax thetamax parameterlistTorus[rmajor rminor phimin phimax thetamax] parameterlist EXAMPLETorus1 .3 60 90 360

**Quadric surface primitives**

Copyright - Sudhir R Kaushik (sudhir@cs.wpi.edu)