MTOR/MEL
|
|
m a y a c v ' s - r e n d e r m a n c v ' s
The number of cv's specified by a Mel script may not result in the same number of cv's defined in the corresponding RIB statement. For example, a Maya curve created using this Mel command, curve -d 1 -p 0 0 0 -p 1 0 0; would be expressed in a RIB file as, |
Curves "linear" [4] "nonperiodic" "P" [0 0 0 0 0 0 1 0 0 1 0 0] "constantwidth" [0.1] |
|
By default, Maya curves are defined in a RIB file as b-spline's,
AttributeBegin
Attribute "identifier" "name" ["|curve1|curveShape1"]
ConcatTransform [1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1]
ShadingInterpolation "smooth"
Basis "b-spline" 1 "b-spline" 1
Curves "cubic" [9] "nonperiodic" "P" [0 0 0
0 0 0 0 0 0 1 1 0 2 -1 0
3 1 0 4 -1 0 4 -1 0 4 -1 0] "constantwidth" [0.1]
AttributeEnd
Because b-spline curves must be defined by no less than 4 cv's, mtor will repeat the first and last points when it produces a RIB file. Lets take a look at another example. In Mel we might have a cubic curve defined by 5 cv's, curve -d 3 -p 0 0 0 -p 1 1 0 -p 2 -1 0 -p 3 1 0 -p 4 -1 0; The same curve written into a RIB file would look like this, Curves "cubic" [9] "nonperiodic" "P" [0 0 0 0 0 0 0 0 0 1 1 0 2 -1 0 3 1 0 4 -1 0 4 -1 0 4 -1 0] "constantwidth" [0.1] In the case of a cubic curve, mtor has repeated the first and last cv's twice. The cv count has gone from 5 to 9. Without this repetition of cv's the curve would not appear to begin and end at the first and last cv. Figure 3 shows a 5 cv curve rendered in red and 9 cv curve rendered in blue. The red "blobs" indicate the locations of the cv's shared by both curves. |
![]() Figure 2 ![]() Figure 3 |
|
c u r v e s e g m e n t s
The RenderMan Interface Specification allows "attributes" to be bound to each segment or span of a curve. Looking at a curve, so to speak, from the "outside" we define the shape of a curve by,
Another tutorial, RiCurves Basics,
illustrates how different curve types produce curves that have very different shapes even
when using identical cv's.
Curves "cubic" [9] "nonperiodic"
"P" [0 0 0 0 0 0 0 0 0 1 0 0 2 0 0
3 0 0 4 0 0 4 0 0 4 0 0]
# one width for each of the 7 segments
"width" [0.01 0.1 0.01 0.1 0.01 0.1 0.01]
To make it easier to see the overlaps between the cv's and the segments, the curve is shown
as a straight line even though it is, infact, a cubic curve. The RIB file that produced
this image can be viewed at curve_segments.rib.
Curves "cubic" [9] "nonperiodic"
"P" [0 0 0
0 0 0 0 0 0 1 1 0 2 -1 0
3 1 0 4 -1 0 4 -1 0 4 -1 0]
"constantwidth" [0.03]
"Cs" [1 1 1
1 1 1
1 0 0
0 1 0
0 0 1
1 1 1
1 1 1]
|
![]() Figure 4 ![]() Figure 5 |
© 2002-5 Malcolm Kesson. All rights reserved.