RenderMan
|
Introduction
This tutorial covers the basic issues of dealing with the RenderMan's
curve primitive. Figure 1 shows four colored b-spline bezier catmull-rom hermite The cv's are colored white and gray connecting lines show the sequence of cv's.
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 " |
'C' CodeThe code for a function called filament() is shown below. It produces a "nonperiodic" curve ie. the end of the curve does not wrap around to the beginning of the curve. The number of cv's passed to this function must conform to the bezier constraint that, (numCV - 1) / 3 divides without a remainder. The function returns 1 if the numCV it has been given satisfies this constraint, otherwise it returns zero to indicate an error. Listing 1
|
© 2002- Malcolm Kesson. All rights reserved.