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.

5.2 Patches<br />

Patches can be either uniform or non-uniform (contain different knot values). Patches can<br />

also be non-rational or rational depending on whether the control points are (x, y, z) or<br />

(x, y, z, w). Patches may also be bilinear or bicubic. <strong>The</strong> graphics state maintains two 4x4<br />

matrices that define the bicubic patch basis matrices. One of these is the current u-basis and<br />

the other is the current v-basis. Basis matrices are used to transform from the power basis<br />

to the preferred basis.<br />

RiBasis ( RtBasis ubasis, RtInt ustep, RtBasis vbasis, RtInt vstep )<br />

Set the current u-basis to ubasis and the current v-basis to vbasis. Predefined basis<br />

matrices exist for the common types:<br />

RtBasis RiBezierBasis;<br />

RtBasis RiBSplineBasis;<br />

RtBasis RiCatmullRomBasis;<br />

RtBasis RiHermiteBasis;<br />

RtBasis RiPowerBasis;<br />

<strong>The</strong> variables ustep and vstep specify the number of control points that should be<br />

skipped in the u and v directions, respectively, to get to the next patch in a bicubic<br />

patch mesh. <strong>The</strong> appropriate step values for the predefined cubic basis matrices are:<br />

Basis<br />

Step<br />

RiBezierBasis 3<br />

RiBSplineBasis 1<br />

RiCatmullRomBasis 1<br />

RiHermiteBasis 2<br />

RiPowerBasis 4<br />

<strong>The</strong> default basis matrix is RiBezierBasis in both directions.<br />

RIB BINDING<br />

Basis uname ustep vname vstep<br />

Basis uname ustep vbasis vstep<br />

Basis ubasis ustep vname vstep<br />

Basis ubasis ustep vbasis vstep<br />

For each basis, either the name of a predefined basis (as a string) or a matrix may be<br />

supplied. If a basis name specified, it must be one of: ”bezier”, ”b-spline”, ”catmullrom”,<br />

”hermite”, or ”power”.<br />

EXAMPLE<br />

Basis ”b-spline” 1 [-1 3 -3 1 3 -6 3 0 -3 3 0 0 1 0 0 0] 1<br />

SEE ALSO<br />

RiPatch, RiPatchMesh<br />

68

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

Saved successfully!

Ooh no, something went wrong!