Wagons Roll

Learn how to make 3D objects from images, create neon signs and stop your wagon wheels from slipping on slick virtual surfaces in this exercise. A great project for intermediate users looking for a few new tricks.

Many animators need to render or animate objects represented only in photographs or drawings. In this exercise, you will learn how to create three-dimensional objects based on two-dimensional images. This exercise also demonstrates a technique which lets you accurately animate the rolling of a wheel. The rotation of a wheel is directly determined by the distance the wheel rolls. The expression assigned to the wheels of the cart in this image ensures that the wheels will rotate exactly the amount required to account for the movement of the cart. This in turn ensures that the wheels appear to roll over the ground rather than just slip against it.

You can click here to download the animation which shows the wagon rolling forward. You can also download the Wagons Roll source file required to complete this exercise, or the finished Wagons Roll file, if you prefer.

All the files listed above are self-extracting .exe files, which means that if you run them they will decompress to either .max files or .avi files, which can then be viewed or loaded using 3D Studio Max.

Creating Neon Text

In this animation, the sign features neon text created by lofting a circle along a spline. You apply a selfilluminated material to the sign that incorporates a Material channel. When you render this animation using Video Post, you can make the text glow.

In the steps below, you learn how to create the path for the neon text by creating a spline, using normal 3D Studio text as a guide. As you create this loft path, you learn and use various techniques that you will find useful whenever you need to draw 2D splines.

1. Hide all objects except the object called Maxtext.

2. Activate the Front viewport and press the W key to change the viewport to full screen.

3. Select the Create tab.

4. Select the Shapes icon.

5. Select the Line icon.

6. Place your cursor in the middle of the lower-left 'foot' of the M.

7. Click and drag up to the upper-left corner of the M.

8. Continue to draw lines through the center line of each letter, creating a continuous path which represents the path of the neon letters. You are aiming for the shape shown in the image below:

9. If you want to back up, you can press the BackSpace key to delete the last point that you made. If you exit the Line command before you complete the continuous path, delete the spline and start again.

Note:

How you place each point is important. If you click the mouse button while the cursor is not moving, you create a straight line. If you click the mouse button and move the cursor before you let go, you create a curved line. How much you moved the mouse determines how curved the line appears. If you right-click before placing the second point, the Line-Drawing command is canceled. If you right-click at any time after placing the second point, the Line-Drawing command is finished.

Modifying the Line

It is easier to change the shape of the line than to create a perfect line from scratch. Select the shape that you want to edit, then select the Modify Spline button from the Modifier command panel. This modifier gives you access to the vertices and segments of a spline, which in turn lets you move vertices and segments to refine the shape of your curve. You can also modify the spline as a complete entity. The main uses of these levels are:

Vertex- You can select and move/delete an individual or group of vertices. You can change the curve/shape of the line going into or out of the vertex by right-clicking a selected vertex. You can also weld selected vertices together.

Segment- You can select and change an individual or group of segments. You can add a vertex to the segment to refine it, or you can straighten a segment by selecting it, then right-clicking it and changing the segment type to linear.

Spline- Lets you attach one spline to another. If you do this with two splines, the face normals of one side of the object may be flipped. To fix this problem, change back to the Vertex level, select all of the vertices by drawing a selection window around the splines, then choose the Weld button from the command panel.

Follow the steps outlined below to refine the shape of your path:

1. Select the spline.

2. Select the Modify tab.

3. Select the Edit Spline button.

4. Select the vertex that you want to move.

5. Use the Select and Move icon to move the vertex.

6. Right-click the selected vertex to change the type.

7. Click and drag the green handles on either side of a curved vertex point to change the curve going through the vertex.

8. To change the curve on one side of the vertex, hold the Shift key down, then click and drag the green handle.

Lofting the Neon Sign

To create the neon sign object, loft a circle along the spline you just created. Follow the instructions outlined below to complete the spline:

1. Unhide the 2D Spline called Circle01.

2. Select the path.

3. From the Create command panel, choose Loft Object from the Geometry drop-down list.

4. Select the Get Shape button.

5. Choose Circle as the shape.

You create the neon material by following the instructions outlined below:

1. Assign a red or yellow material to the lofted object. Create the material with a Self-Illumination value of 100. Change the Material Effects Channel number to 1. If you do not know how to create a red or yellow self-illuminated material how to create materials.

2. To see the effect, unhide all geometry and render the Camera viewport using Video Post to glow the neon material with a Glow Size value of around 15.

You have just created neon text. You can use this technique to dress up virtual bars or roadside cafe's along the super-highway.

Creating Objects from Photographs

In the sections that follow, you load a bitmap image as a background and display it in the Front viewport so that you can trace over it. This technique is very useful when you need to recreate a logo or an object in a photograph.

Note: You can also use this technique to create plants and flat people in your animations. When creating plants, you might want to rotate and copy the flat plant objects so that they are at right angles to one another. This creates 'almost' 3D plants.

Note: You can't zoom in or out of the bitmap when it is displayed as a background in a viewport. It fills the viewport, and you can only alter the display of your 3D objects in front of the bitmap. The bitmap image used for this exercise is called OLDWOOD.JPG, which you can find in your Default Maps directory.

1. From the Views main menu, select Background Image.

2. Select the Files button from the Background Source panel.

3. Search for and select the OLDWOOD.JPG file. After you have found the image, you can click the View button to take a look at the image before you assign it.

4. Select OK to return to the Viewport Background dialog box.

5. Select the Display Background checkbox to activate the display of the image in the viewport.

6. Select the Bitmap checkbox in the Aspect Ratio section so that the image does not distort in the viewport.

Tracing the Image

Use the techniques described on the previous page to draw a single, continuous line around the edge of the wood image. Follow the grain of the wood and draw lines that inset at the ends of the planks of wood in the image.

After you have drawn the line around the image, you will extrude it, so make sure your spline is closed. You can close the spline in one of two ways:

1. Double-click to automatically join the last vertex to the first vertex, or

2. Place your cursor over the first point. When the cursor changes into a cross, you can close the polygon by clicking.

Extruding a Polygon

Now that you have created the spline, extrude it to create a 3D object.

1. Select the Spline.

2. Select the Modify tab.

3. Click the Extrude button.

4. Enter 20 in the Amount field for the thickness of the extrusion.

5. Select the UVW Modifier button and the Fit button at the bottom of the command panel to shrink the mapping coordinates to the size of the extruded shape.

Assigning a Bitmap to an Object

To create a material which will place the bitmap you just traced right on the object you just created, follow the steps outlined below:

1. Select the extruded object.

2. Select the Material Editor icon.

3. Select the Diffuse button and select the OLDWOOD.JPG image for the material.

4. Select the Assign Material to Selected icon.

5. Select the Show Map in Viewport icon. This shows the material assigned to the object in the shaded
viewport.

6. Adjust the position of the map using Offset and Tiling. This lets you line up the bitmap precisely with
the extruded object.

7. Render the Front viewport to see the image on the object.

Note: You can always view maps in viewports. The trick is to be at the Image Allocation level in the Material Editor, as the Show Map in Viewport icon then becomes active. When you click this icon, the image will be displayed in shaded viewports.

Use this technique whenever you need to create objects based on photographs or drawings.

Making Wheels Roll Correctly

The following example shows how to make a wheel roll along the ground without the circumference of the wheel slipping. The wheel follows a dummy object, and the rotation of the wheel is calculated in proportion to the distance that the dummy object travels in the X direction. This ensures that the wheel rotates exactly enough to account for the movement of the dummy object. By linking a cart to the dummy object, you ensure that moving the dummy object makes the cart move and the wheel roll exactly as physics demands. You can use the technique illustrated here whenever you have a wheel or cylinder that you want to roll along the ground.

To create the expression, use two dummy objects, one to establish the starting position of the wheel and the other to calculate the distance moved from the original position. When you create the dummy objects, do not change their names from Dummy01 and Dummy02, so that you can follow the rest of the example. Dummy02 represents the original position and Dummy01 represents the new position. Note: The wheel object is a grouped object in the scene, and grouped objects cannot contain an expression controller. A dummy object linked as a parent to the wheel has the name Wheel. This is the object used for the rotation controller in the example.

Changing the Controller of an Object

The first stage in assigning this expression controller to an object is to change the wheel object's default Rotation controller to Euler controller.

1. Create a dummy object near to the front wheel of the wagon. The exact position is not important. Make sure that the dummy object has the name Dummy01.

2. From the Edit main menu, choose the Clone option to create a clone of the selected object. Make sure that the clone copy has the name Dummy02.

3. Click the Select and Link icon from the main toolbar and link the wheel object as a child of the Dummy01 object. You may have to press the H key to select the Dummy01 object.

4. Select the wheel object so that you can change its controller.

5. Select the Motion tab to open its command panel.

6. Select the Assign Controller rollout to open the section.

7. Select Rotation from the Hierarchy list.

8. Click the green Assign Controller icon above the Hierarchy panel.

9. Choose Euler XYZ from the list and OK the dialog window.

10. Go back to the Hierarchy list and highlight Y Rotation.

Assigning a Rotation Expression Controller

Having changed the Rotation controller for the wheel to Euler rotation, the second stage is to add an expression controller to the Euler rotation for one of the axes. When you use Euler rotation with a calculated expression, the axes used are based on the World axes.

1. Highlight Y Rotation in the Hierarchy panel.

2. Click the Assign Controller icon just above the Hierarchy panel.

3. Choose Float Expression and OK the dialog window.

4. Highlight Y Rotation in the Hierarchy list; it should now say Float Expression to the right.

5. Right-click Y Rotation and choose Properties from the list. This opens the expression controller.

Expression Controllers

Generally, you use the expression controllers to calculate positions of objects. In this example, you enter a specific calculation or expression for the Y rotation of the wheel object. You can make one object in your scene refer to the position of another object in your scene by creating a variable that stores the position of the first object. You create and use this variable in the expression controller for the second object. In this exercise, you use this technique twice, once to capture the position of the original dummy object and again to capture the position of the dummy object attached to the wheel. You also enter the formula for the angle of rotation of the wheel in relation to how far it moves from the original position.

1. Enter the letters dold in the Name panel of the Create Variables section.

2. Click the Vector checkbox.

3. Select the Create radio button.

4. Select the Assign to Controller radio button.

5. Open the Objects hierarchy until you see the position track for the Dummy02 object.

6. Highlight the position item for the Dummy02 object and OK the dialog window.

7. Repeat all of the above steps with a variable name of dnew and assign the Dummy01 object to that variable.

Entering an Expression

If you successfully created the two variables in the previous steps, you can now enter the calculation for the angle of the wheel. The expression or calculation that you enter now is evaluated and applied to rotate the wheel along the Y axis. The number in the expression area represents the current angle of the wheel, which should be zero. Enter the expression exactly as it appears in the following picture:

If you move Dummy01, the wheel will roll exactly the amount required to account for the movement of that dummy object.

To finish the model:

1. Repeat the steps outlined above to create a Dummy03, which controls the rotation of the second wheel.

2. Link all the components of the cart, including the wheels, to the Dummy01 object. Moving the Dummy01 object will then move the cart and roll the wheels.

Note: Moving the Dummy02 object will also roll the wheels (although not move them), because you are
moving the point from which roll distances are measured.

Did you like this lesson or perhaps you would like to comment on it or need help. Go to our discussion area and start a new discussion or start a new article, or ask for help and a MaxNet Engineer will respond.

|Home|

 

| Tech Articles 1 Tech Articles 2 | Site Map | | Add an article or comment |

01/09/2005  2005 MaxNet IT Solutions     Site Design;  EliteSolutions All Rights Reserved