Rib
Curve Basics


return to main index

References

    Nurb Curves: A Guide for the Uninitiated
      http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html



Introduction

This tutorial covers the basic issues of dealing with the RenderMan's curve primitive. Figure 1 shows four colored Curves, that have been rendered using different "curve types" but sharing identical control vertices (cv's).

    b-spline
    bezier
    catmull-rom
    hermite

The cv's are colored white and gray connecting lines show the sequence of cv's.



Figure 1


There is a clear difference between each of the curves. In particular, notice the green bezier curve is the only one to begin and end at the first and last cv. The RIB statements used to render the bezier curve are,

Basis "bezier" 3 "bezier" 3
Curves "cubic" [4] "nonperiodic" 
                   "P" [-0.75 0 0.5  -0.45 0 1  0.5 0 0  0.75 0 1]
                   "constantwidth" [0.005]
                   "Cs" [0 1 0   0 1 0]

The rib file used to render this image can be viewed here. Curves generated by Maya and mtor/Rfm the curve type is "b-spline" ie.

    Basis "b-spline" 1 "b-spline" 1

Refer to rendering Maya curves with prman.


Assumptions

Although a RenderMan curve might look as if it can be defined by an arbitary number of cv's - in the example shown above the "P" list contains four lots of xyz's. Infact, the number of cv's must conform to formula determined by the type of curve being rendered. The simpliest curve type to use is a "b-spline" because it can be defined by any number of cv's - greater than 4. Unfortunately, in general a "b-spline" curve does not begin and end at the first and last cv.

A "bezier" curve does have the desirable property of starting and finishing at the first and last cv. However, the number of cv's, less 1, must be exactly divisible by 3. For instance, we might use 4, 7, 10 or 13 cv's for a "bezier" curve. The only time when the restriction on the number of cv's can be ignored is when a "periodic" curve is produced, in which case, the end of the curve wraps around to coincide with the beginning of the curve. A single RenderMan Curves statement can define multiple separate curves.