26.01.2015 Views

The RenderMan Interface - Paul Bourke

The RenderMan Interface - Paul Bourke

The RenderMan Interface - Paul Bourke

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

NURBS may contain trim regions and holes that are specified by giving curves in parameter<br />

space.<br />

RiNuPatch ( RtInt nu, RtInt uorder, RtFloat uknot[], RtFloat umin, RtFloat umax,<br />

RtInt nv, RtInt vorder, RtFloat vknot[], RtFloat vmin, RtFloat vmax,<br />

...parameterlist...)<br />

This procedure creates a tensor product rational or polynomial non-uniform B-spline<br />

surface patch mesh. parameterlist is a list of token-array pairs where each token is<br />

one of the standard geometric primitive variables or a variable that has been defined<br />

with RiDeclare. <strong>The</strong> parameter list must include at least position (”P” or ”Pw”) information.<br />

<strong>The</strong> surface specified is rational if the positions of the vertices are 4-vectors (x,y,z,w),<br />

and polynomial if the positions are 3-vectors (x,y,z). <strong>The</strong> number of control points in<br />

the u direction equals nu and the number in the v direction equals nv. <strong>The</strong> total number<br />

of vertices is thus equal to (nu)*(nv). <strong>The</strong> order must be positive and is equal to<br />

the degree of the polynomial basis plus 1. <strong>The</strong>re may be different orders in each parametric<br />

direction. <strong>The</strong> number of control points should be at least as large as the order<br />

of the polynomial basis. If not, a spline of order equal to the number of control points<br />

is computed. <strong>The</strong> knot vectors associated with each control point (uknot[], vknot[])<br />

must also be specified. Each value in these arrays must be greater than or equal to<br />

the previous value. <strong>The</strong> number of knots is equal to the number of control points plus<br />

the order of the spline. <strong>The</strong> surface is defined in the range umin to umax and vmin to<br />

vmax. This is different from other geometric primitives where the parameter values<br />

are always assumed to lie between 0 and 1. Each min must be less than its max. min<br />

must also be greater than or equal to the corresponding (order-1)th knot value. max<br />

must be less than or equal to the nth knot value.<br />

A NuPatch may be thought of as a nonperiodic uniform B-spline mesh with (1+nu−uorder)<br />

segments in the u parametric direction, and (1+nv−vorder) segments in the v parametric<br />

direction. RiNuPatch primitive variables are therefore defined to have one<br />

uniform value per segment and one varying value per segment corner. <strong>The</strong> number<br />

of uniform primitive variables is therefore nusegments × nvsegments, and the number<br />

of varying variables is (nusegments+1) × (nvsegments+1). Note that this results in redundant<br />

parameter values corresponding to repeated knot values, for instance when<br />

the knot vector indicates the RiNuPatch is in Bezier form. Primitive variables of class<br />

vertex contain nu × nv values of the appropriate type, and are interpolated using<br />

the same methods as the surface position ”P”. Primitive variables that are of class<br />

constant will have a single value for the entire mesh.<br />

If texture coordinates primitive variables are not present, the current texture coordinates<br />

are assigned to corners defined by the rectangle (umin,umax) and (vmin,vmax)<br />

in parameter space.<br />

RIB BINDING<br />

NuPatch nu uorder uknot umin umax nv vorder vknot vmin vmax ...parameterlist...<br />

EXAMPLE<br />

NuPatch 9 3 [ 0 0 0 1 1 2 2 3 3 4 4 4 ] 0 4<br />

73

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!