All of the titles for the robot demo operations will be shown here in bold beginning with the operation number followed by the title itself.
Operations 0 to 5 should be treated as a complete tutorial that teaches how to make a simple skinned model that can be animated using the same techniques shown in the beeline to animation tutorial.Operations 6 to 9 are a continuation of the tutorial but are aimed at users who want to learn how to hand edit scripts so if you are more interested in modeling and/or key frame animation skip to operation 10 or to the nurbs patch avatar tutorial after operation 5 in this tutorial.
Click on the new smls file button
and save the new smls file as worm_animation.smls
Open the scene tree window
Create a structure of 8 parts and name them as shown
Like this each part except for seg0 will have a parent part it belongs
to. We will later see how each parent part will have an affect on their descendants when they are animated.
2. Build the Triangles
Select the part named seg0 and click
so that a NurbsLathe
referencing seg0 is plugged into the smls node.
Select the NurbsLathe and set the bands field to 12:
At this stage seg0 contains/owns all the vertices. If we click the vertices are coloured to show what parts own which vertices.
To transfer different portions of the vertices to the other parts plug in a TransferOwnership node:
Plug in seg0 as a source reference by dragging the part to the blue dot while holding down the Alt key (The blue dot won't appear until the mouse is dragged to the right of the TransferVertex node):
Plug in parts seg0 to seg7 as destination references by dragging each part to the red dot while holding down the Alt key:
Note after the parts have been referenced, the source part is distinguished from the destination parts by the blue dot:
Click on the TransferOwnership node to select it and then click on the length up button to add an element for the numOf and qty fields. Since our rings contain 16 vertices leave the qty set to 16. Set the numOf field to 3 so that the seg0 owns 3 rings. Because the first ring is in fact a single vertex check the beginSP box.
Increment the length again to add the next element for the numOf and qty fields and set the qty value to 1 so that only 1 ring is transferred to seg1.
in the scene tree shows which destination part corresponds to the selected element.
When in coloured ownership mode the vertices owned by the selected part are coloured
white. When a TransferOwnership node is selected the vertices owned by the marked
part are coloured white.
Increment the length button to 7 elements so that there is an element specified
for part seg0 to seg6. We do not need or want an element for seg7 because the last
destination part referenced by the TransferOwnership gets to own the remaining
vertices if no element is specified for it.
To be able to animate our worm we must move each part's pivot point (the point at which the part rotates around) to the appropriate location. To move a part's pivot point, select the part and use the buttons from the horizontal tool bar or write in the values directly to the part's pivotPoint field.
Same as with most other non rotation buttons, they increment and decrement in 1 centimeter amounts and 1 millimeter amounts when the control key is held down.
The yellow dot displayed in the 3d window shows the location of the selected part's pivot point:
Remember the selected part's vertices will be shown in white.
If you have trouble seeing the pivot point, zoom in using the mouse wheel or use
buttons. To center the view around a pivot point click the
When moving the pivot points the yellow dot should be viewed from both front on and side on
Because pivot points are relative to their parent part, you should move the pivot points beginning from seg0 and ending with seg7. If you need to move a part's pivot point without changing the location of any of the children pivot points, hold down the Alt key while moving the pivot point.
Rotation calcRot(float v, float d)
float a = sin((v + d) * PI * 2) * .2
return Rotation(0, 0, 1, a)
seg0.rotation = calcRot(v, 0)
seg1.rotation = calcRot(v, 0)
seg2.rotation = calcRot(v, 0)
seg3.rotation = calcRot(v, 0)
seg4.rotation = calcRot(v, 0)
seg5.rotation = calcRot(v, 0)
seg6.rotation = calcRot(v, 0)
seg7.rotation = calcRot(v, 0)
seg0.rotation = calcRot(v, 0)
seg1.rotation = calcRot(v, .071)
seg2.rotation = calcRot(v, .143)
seg3.rotation = calcRot(v, .214)
seg4.rotation = calcRot(v, .286)
seg5.rotation = calcRot(v, .357)
seg6.rotation = calcRot(v, .429)
seg7.rotation = calcRot(v, .5)
seg0.rotation = calcRot(v, 0 / 7 * .5)
seg1.rotation = calcRot(v, 1 / 7 * .5)
seg2.rotation = calcRot(v, 2 / 7 * .5)
seg3.rotation = calcRot(v, 3 / 7 * .5)
seg4.rotation = calcRot(v, 4 / 7 * .5)
seg5.rotation = calcRot(v, 5 / 7 * .5)
seg6.rotation = calcRot(v, 6 / 7 * .5)
seg7.rotation = calcRot(v, 7 / 7 * .5)
We will use a ColorSweep to colour our worm with yellow and red stripes. We should stop the Anim bar so that we can see where to drag the ColorSweep's control points to. For avatars there can be advantages in colouring parts after the ownership has been transferred to all the parts but for our worm if we insert the ColorSweep before the TransferOwnership, the ColorSweep will only need to reference 1 instead of 8 parts.
To insert the ColorSweep between the NurbsLathe and the TransferOwnership drag the new ColorSeeep to the upper half of the TransferOwnership's icon before letting go:
Click the ColorSweep's length button up to add control points.By dragging a control point to each ring, each ring will be assured of having the colour we specify. We specify the colour for a control point by clicking it and typing in the colour to the colour field: