You are on page 1of 29

Introduction to 3D brush stokes, organic shapes and interactive character animation

Sciviz 2006 - Jean-Marc Gauthier - All rights reserved

Animated creatures with moving arms, blades of grass, trees moving in the wind can be fully interactive. They can be animated in real time using sensors and input devices. This tutorial shows how to create a real time kinematics system for interactive character animation using Maya and Virtools. The roadmap Part 1 shows how to model and rig a character in Maya. Part 2 shows how to add interactivity in Virtools

1-1, 2,3 Modeling a tree structure using curves, from extrusion to smoothing in Maya

Left illustration -1-4, 5 Rigging and animating the tree structure in Maya Right Illustration 2.1 The tree becomes interactive in Virtools with a real time animation controlled by only two points connected to input devices. .

Top view of the interactive tree in Virtools. Part 1- modeling a flexible tube along a Curve 1.1 Modeling tubes with curves and Paint Effects Lets draw the curve. By default the curve snaps on the grid. ( Go to Display > Grid). Go to Create > Create a CV curve, select 3 cubic, uniform. Press Enter. To smooth the curve, go to Edit Curve > Rebuilding Curve To edit the curve, go to Edit Curves > Curve Editing Tool Lets modify the curve by projecting on the shape ofa 3D object, for example a sphere. Please not that the 3D object needs to be a Nurbs object. Select the curve, SHIFT select the sphere, go to Edit Nurbs > Project Curve on Surface, see options in following illustration.

Please note that Active View projects the curve along the ray of the perspective camera if you are in the perspective view or along the ray of the default camera in the active window of your choice, for example top camera in top view.

After projection, the new curve is part of the surface of the sphere. You need to duplicate the new curve in order to use it independently. Go to Edit Curves > Duplicate Surface Curves.

Lets apply a paint effect to the curve. Select the curve. Go to Windows > General Editors > Visor, select Oils > LMB on OilTexBlue. Go to Rendering > Paint effects > Curve Utilities > Attach Brush to Curve. The curve changes color.

Make sure that the curve is selected. In the attribute Editor, check OilTexBlue >Global Scale to adjust the size of the brush applied to the curve. Render the curve.

Go to Modify > Convert > Paint Effects to Polygons, render the curve and compare with the previous rendering. SAVE YOUR WORK. 1.2 Modeling a tree structure with curves and extrusion Lets model a tube along a curve by using the extrusion tool. Please note that this method allows you to create tubes of various profiles and branching structures. Lets draw the curve. By default the curve snaps on the grid. ( Go to Display > Grid). Go to Create > Create a CV curve, select 3 cubic, uniform. Press Enter. Go to Create > Polygons Primitives > Plane, set subdivisions = 1. Place the plane facing the starting point of the curve. The first point created when drawing the curve.

Select the Plane, SHIFT select the curve. Go to Edit Polygons > Extrude face,

Tapper and Twist to refine your volume. Check Other Values > choose a division number between 10 and 20

Select the object mode, LMB on the tube, the tube looks green, Adjust the taper curve in order to reserve sections of growth along the plant. Lets create a secondary branch. Go to Selection by Components > Faces Make sure that only one face is selected. Hold the shift key and click selected face in order to deselect them.

Lets extrude the selected face. Go to Edit Polygons > Extrude Face, make sure that Other Values > Division Number is set to 1. SAVE YOUR WORK.

Please note that the extrude tool combines move tool and scale tool. Step 1, LMB+drag the arrows. Step 2, LMB + drag the cubes.

Lets draw a second curve with the CV Curve Tool. To create a branch from the main tree, we are going to extrude one face of the tree along the second curve.

Step 1, in the Object Component > Face mode, select the face of the tree to be extruded. Make sure that you select only one face. Step 2, SHIFT + select the curve. Right click on the curve and select object mode in the selection wheels that pops up on the screen. Step 3, go to Edit Polygons > Extrude Face. The branch appears along the curve. See following illustration. Select the object mode, LMB on the tube, the tube looks green, go to Attributes Editor > Polyextrude2 (or 3) change the number of divisions.

You can change the number of polygons, Check Other Values > type a higher division number. SAVE YOUR WORK. To smooth the curve, go to Edit Curve > Rebuilding Curve To edit the curve, go to Edit Curves > Curve Editing Tool You can change the number of polygons again , Check Other Values > choose a higher division number for example 60. You can also delete the branch. If you are left with a hole, you can fill the hole by recreating the missing polygon(s) on the tree. Go to Polygon > Append Polygon Tool, LMB on the edge of the hole, purple arrows are visible, LMB the edges following the arrows. A pink poly is recreated in place of the hole.

After creating your design, enjoy a smooth organic look for your tube. Select the object mode, LMB on the tube, the tube looks green, go to Polygons > Smooth.

Top view, single tube. Bottom view tube with branching, check the clean intersection

Now we are ready to rig the tree for animation. Lets make the tube see through so we can create joint in the middle of the tube.

Go to Shading > Smooth Shade > Shade Options > XRay

SAVE YOUR WORK. 1.3 Rigging and animating - for tubes and tree structures

Please note that you can use the following rigging regardless of the way you create the geometry. For example using Paint Effects convertd to polygons instead of extrusion.

Change your windows layout. Go to Panels > Layouts > Two Panels Side by Side, Choose Top view and Side view.

After creating the joints for the main tree, lets create branching joints for the branches. Step 1, select the nearest joint on the main tree for example joint 6 is selected in Outliner

Go to animation > Skeleton > Joint Tool, insert a point in the middle of the branch > a joint is created between the main chain and the branch.

Continue to create joints for the branch joints 16 to 26. The following illustration shows the relationships between the tree structure in top view, in Outliner and in Hypergraph ( Windows > Hypergraph}..

SAVE YOUR WORK. Lets bind the tube the skin- and the joints the skeleton. Go to Outliner, select joint #1, SHIFT + select the tube. Go to Skin > Bind > Smooth Bind.

SAVE YOUR WORK. Test the rig by selecting a joint and applying the rotate tool or scale DO NOT APPLY THE MOVE TOOL

1.4 Inverse Kinematics Lets apply an Inverse Kinematics chain to the tree structure from joint 1 origin of the tree, to joint 17 at the end of the tree. Go to Skeleton > IK Handle Tool, select LMB joint 1, select LMB joint 17. The Inverse Kinematics connection shows up in green between the two joints. Select the move tool and test the IK chain by moving joint 17. All the in-between joints move together and follow the motion of joint 17.

Lets add a second Inverse Kinematics chain for the branch starting at joint 19 ending at joint 30. Test joint 30 with the move tool. See the following illustration.

Lets look at the updated Hypergraph with IK chains

At this point you can create an animation of the tree in Maya, with or without IK SAVE YOUR WORK. This is half of the fun in comparison to a fully interactive tree that can react to wind simulations recreated with sensors and input devices. 1.5 Lets export the tree to Virtools.

IMPORTANT: save the tree in the data resource > Characters folder in order to keep the joints active in Virtools

Part 2 Interactive animation in Virtools 2.1 The tree becomes interactive

Go to your data resource folder on the right side of the interface > Characters > tree, drag the tree inside 3D layout. Add lights if needed. Go to Level Manger > Characters > tree > Body Parts > joints, check that you have all the elements of the tree created in Maya. Since we are going to move the IK handles in order to animate the mesh of the tree we want to be sure that all of these elements have Initial Conditions. Step 1- Go to Level Manager > Levels > Meshes > select Plane-mesh or treemesh and set Initial Conditions. Step 2- Go to Level Manager > Levels > 3D frames > select IK handle 1 and IK handle 2, and set Initial Conditions.

We need to reconnect the Inverse Kinematics chain in Virtools using the IK building block. Go to Building Blocks > Characters > IK > IK Position, You can drag and drop the BB on the tree in 3D Layout. The dialogue window for the BB will open on top of the tree. Another way - see illustration below - is to LMB and drag the BB in Level Manager > Levels > Characters > tree. A tree script is added under the name of the tree. LMB on the tree script to open the BB in Schematic.

You need to edit the IK Position BB with the information that you created in Maya. Zone red in the illustration below. Starting joint number to start the chain. Ending joint number to end the chain, name of IKHandle or goal. Zone yellow in the illustration below. Repeat the same steps for each branch.

Now it is time to test the IK Handles press play select the move tool and gently move the IK Handles, the whole tree animates by moving only two control points.

The tree in motion.

You might also like