الاثنين، 3 أغسطس 2009

3ds Max Tutorial: Lathe (Wine Glass)


Objects such as table legs and wine glasses are bestmodeled using a technique called a surface of revolution. A 2D spline curve is revolved around a central axis to create a surface. In 3ds Max, this is achieved through a modifier called Lathe. As you may know, a lathe in the real world is a machine that cuts a spinning piece of wood or metal.

This tutorial is very thorough; it will take about two hours to complete. In it, you’ll construct a professional quality model from real-world reference. You’ll learn to create custom curves using Editable Spline, apply and adjust a Lathe modifier, and control the level of detail of your model.

You’ll also learn all about how to set up a 3ds Max scene for the correct real-world scale. This is a very important process, but it’s not obvious to new users. So that is where we’ll begin, setting a scene and establishing good habits for digital asset management. Along the way, we’ll also take a look at customizing the 3ds Max user interface. We will set the color and layout of the viewports to our preferences.


Part One: Pre-Production

1. Design Inspiration

It’s tempting to jump right into our 3D program and start experimenting. However, that's usually not a good idea. We’ll save a lot of time if we start off with an idea of what we’re trying to accomplish. In this case, we’re modeling a wine glass, so it makes sense to look at examples of wine glasses. We could look in our own cupboards, or go on the Internet, or look in books and catalogs. In fact, for each project you do, you should build a library of reference images.

Don’t forget to document your sources. It’s no good to download a bunch of images and not know what they are or where they came from. At the very least, save each file with a descriptive name of the item, model number, and website URL. If you’re reproducing an existing product, make sure you know its exact dimensions, and save that information with the images.

Also remember that you don’t own the copyright on any images you find on the Internet. It’s OK to create a study of a commercial product or trademark, but only for your own educational purposes. As always, give credit where it is due.

Reference images come in two flavors: perspective and orthographic. These are, of course, also the two types of viewports in a 3D program. In a later tutorial, we’ll look at how to load orthographic technical drawings into 3ds Max. Right now, we’re just going to use a perspective photograph as a more “casual” reference image.

Any bitmap image on your computer can be viewed within 3ds Max. Just go to the File menu and choose View Image File. You can load as many images into 3ds Max as you like. Each image loads in its own window, which you can minimize if needed. The advantage to doing it this way instead of using an external file viewer is that the image window always stays on top of the 3ds Max interface.


File > View Image File...

I found this beautiful teardrop-shaped wine glass from the manufacturer Libbey. You should find your own sources of inspiration. You can model an exact replica of an existing design, or create your own design based on your research.

2. Customize User Interface

Open 3ds Max, or if it is already open, select File > Reset.

As you work, you may find that the default viewport background color makes it difficult to see the grid at all. Let’s make the background brighter so we can see what we’re doing.

From the Main Menu, choose Customize > Customize User Interface. In the Customize User Interface dialog, select the tab labeled Colors. In the Elements pulldown list, Viewports is selected by default. In the list of Elements, scroll down until you see Viewport Background, and click it.

With Viewport Background highlighted, click the color swatch on the upper right of the dialog box. The 3ds Max Color Selector appears. Increase the Value parameter to 160 and click OK to close the Color Selector.


Adjust the Viewport Background color

Now, back in the Customize User Interface dialog, click Apply Colors Now. You’ll see the background of the 3ds Max viewports become brighter.

If you wish, you can also change the color of the grid. It’s found in Customize User Interface > Colors > Elements: Grids. I like to use the Set By Intensity option, with a value of 140.

Part Two: Scene Setup

1. Units Setup

Let’s set the units in 3ds Max to feet and inches. This way, we’ll be able to model objects to real-world scale. That’s really important. All of your models should be built in separate scenes, but they must all be created to the same scale. It's no good if your wine glass is 50 feet tall, but the table it’s supposed to sit on is only six inches tall.

Go to the Customize menu, and select Units Setup. The Units Setup dialog opens. Don’t worry about the System Unit Setup, we're only concerned with the section labeled Display Unit Scale. This setting doesn’t affect the size of objects, it just changes the type of measurement. You can alter the Display Unit Scale at any time, switching back and forth between Metric and US units if needed, and that’s OK.

This tutorial uses Imperial measurements of feet and inches. In the Units Setup dialog, set the Display Unit Scale to US Standard. The drop-down list should read Feet w/ Fractional Inches, and that’s fine for us. Under Default Units, select Inches. Now, when you type distance values anywhere in 3ds Max, the values will be interpreted as inches. When you type in 12, 3ds Max interprets it as 12 inches. If the Default Units were set to Feet, and you typed in 12, 3ds Max would interpret it as 12 feet.

Warning: Don’t change the System Unit Setup! Leave it at the default setting, which is Inches. If you mess around with System Unit Setup, you could have serious problems with your scene, including corrupted models and lost data. That’s because System Unit Setup controls the internal accuracy of measurement in 3ds Max. The only time it should ever be adjusted is before modeling scenes that are very, very large, such as a whole city. Whatever you do, don’t change the System Unit Setup with an existing scene open! This could result in your scene crumpling into a horrible mess due to round-off errors. You have been warned!

2. Home Grid Settings

Next, we must also adjust the settings for the Home Grid. In fact, whenever you change the Units Setup, you’ll need to adjust the Home Grid settings accordingly.

Snap tools
To adjust the grid, you’ll need to open the Grid and Snap Settings dialog. Look for the Snap buttons on the Main Toolbar. Just right-click on any of the magnet icons to open the dialog.

In Grid and Snap Settings, the Snaps tab is active. The only option that should be checked is Grid Points. Now click the tab labeled Home Grid. Here’s where we determine the spacing of lines on the grid. Notice that the values are in inches. Set the Grid Spacing to one inch. This means 3ds Max will draw minor grid lines every inch.

Below Grid Spacing, you’ll see a field labeled Major Lines every Nth Grid Line. This sets how far apart the major grid lines will be. It’s expressed as a multiple of the Grid Spacing value. In this case, we want minor lines spaced one inch apart, and major lines spaced 12 inches apart. So the Major Lines every Nth Grid Line value should be set to 12. Major lines will be drawn every 12 inches, or every one foot.

The Perspective View Grid Extent field controls the size of the Home Grid in the perspective view. The grid extends infinitely in orthographic views, but not in perspective views. Set this value to 24. Now the visible grid measures 24 inches from center to edge in the Perspective view. Our grid is 4’ x 4’, or 16 square feet.

Note: You’ll still be able to snap to the grid in the Perspective view, even in areas where the grid is not visible.

3. Template Scene

In the sometimes complicated world of 3D graphics, we need to take special steps to safeguard our work, and those steps aren’t often obvious. It’s never as simple as just saving a file wherever you feel like. So, the following process might seem unusual, but trust me: there’s a method to our madness here. Taking a few simple precautions at the beginning of a project will save us a lot of grief later on.

The next time we create a new scene, 3ds Max will remember the Units Setup we chose, but it won’t remember our Grid and Snap Settings! 3ds Max will always default to a Grid Spacing of ten inches. This could be a serious problem for modeling if we’re supposed to be working in feet and inches. The solution is a bit of 3ds Max voodoo: create a special template scene, then we won’t need to change the grid every time. This is because of the way 3ds Max stores Grid and Snap Settings: they are saved within each separate .MAX scene file, not in the global settings of the Customize menu.

From the Main Menu, choose File > Save. In the Save File As dialog, 3ds Max takes you to the default save location, which is in the \scenes folder of the current project. We’ll look at project folders in a later tutorial. For now, save in the default location, which is: My Documents\3dsmax\scenes. Save the scene with this filename: maxstart.max. Don’t add the .MAX extension, 3ds Max does this automatically. So all you need to type in is maxstart.


Save the template scene maxstart.max

Now we have created a special template scene called maxstart.max. It is located in the folder My Documents\3dsmax\scenes. When we launch 3ds Max, or choose File > Reset, the template scene is loaded.

Note: You can create many template files if you wish, each with different settings. Only maxstart.max is loaded automatically.

At this point we should save the file again, to a new filename. We don’t want to mess up the template file we’ve created. This time, we’ll save our empty scene to a filename called wineglass_01.max. Now our project has really begun.

Note: Windows hides filename extensions by default. This is not helpful; we need to know exactly what we’re dealing with. If you look in any Windows Explorer file browser window, but don’t see extensions such as .DOC, .MAX or .JPG, then you should unhide them. In Windows XP, this setting is in Windows Explorer > Tools > Folder Options > View > Hide Extensions for Known File Types.

4. Reference Box

This will be a small red wine glass, six inches in height. Yours might be a slightly different size, but it should be in the range of four to eight inches tall. We’ll model it at 1:1 real-world scale.

It’s often challenging to get a sense of scale in the 3ds Max viewports, because there is no option to display numbers on the grid. The standard workaround is to create a temporary Box as a ruler: an intuitive visual point of reference for object scale. This Box only exists so that we can easily see if our viewports and grids are sized properly.

Go to the Create panel and create a Standard Primitive Box. Build it somewhere near the origin of the world. With the Box selected, open the Modify panel. In each of the Length, Width, and Height parameter fields, type in the number 12. Since we chose Inches as the Default Units earlier, 3ds Max interprets the number 12 to mean 12 inches. 3ds Max automatically displays this as one foot. The fields now read 1’0”.

Press the Z key on the keyboard. This is Zoom Extents All Selected. All viewports zoom in or out to display the selected object(s). Adjust the Front viewport and the position of the box so it looks something like the following illustration.


Create a reference box measuring one foot on each side, and position it in the Front view.

Part Three: Line (Editable Spline)

1. Create a Line

With the Front viewport active, maximize the viewport with the keyboard shortcut ALT + W. Make sure the viewport label at the top left doesn’t say User or Orthographic. If it says anything other than Front, then press the F key on the keyboard to load the Front view into the current panel.

Zoom in to the Front view a little bit, remembering that the grid lines are spaced one inch apart. We want to zoom in to build something about six inches tall.

Now activate 3D Snaps with the S key on the keyboard. You may also click the 3D Snaps Toggle button on the Main Toolbar. As you move the cursor in the view, the blue Snap cursor should only snap to Grid Points. If that's not working for you, go back into the Grid and Snap Settings dialog by right-clicking the magnet icons. Make sure that Grid Points is the only checkbox activated in the Snaps tab.

Now we will use the Line tool to build half of a rough profile. The operative word here is rough. We’re only blocking out the line at this stage, we’ll refine it later. The first point on the new curve needs to be at the origin. The last point needs to be positioned precisely above the first point. In other words, both points need to be snapped so that their X position value is zero.

Go to the Create panel and choose the Shapes category. Click at the origin, where the axes of the Front viewport meet. Then click a few more times in a counter-clockwise fashion. Again, we’re just making a very rough outline at this stage. The last point must be snapped to the axis as shown in the following illustration. After creating the last point, click the right mouse button to complete the Line. Do not click on the first point to close the spline. Right-click again to exit the Line tool.


A very rough half profile

Warning: Don’t hold down the mouse button when clicking to create points. If you click and drag while building a line, you’ll create curved segments. At this stage, we just want straight lines and sharp corners.

2. Editable Spline Sub-objects

We’ve just created a Line object. This is the same as an Editable Spline object. You can also convert a Shape, such as a Text object, to Editable Spline. Whether you use the Line tool, or convert a Shape, you end up with an Editable Spline object. It has many tools for shaping the curve, but we’ll only need to use a few of them to make our wine glass.

Click the plus sign
With the line selected, go to the Modify panel. At the top of the Modify panel is the object name and color. Currently, the object is named Line01. Change the name to WineGlass01.

Also in the Modify panel, you’ll see an area called the Modifier Stack. This is a list of program modules that do work for us. Currently, the only thing listed in the Modifier Stack is the Line object.

Click the plus sign to open up the Line Sub-object modes. Sub-objects are parts or components of objects. The three component types of a Line object are Vertex, Segment, and Spline.

Vertex is a fancy word for point. The plural of vertex is vertices. Points on curves are also commonly known as control vertices, or CVs.

Segment is a part of a curve between two vertices. It’s also known as a span.

Spline is a series of connected Segments. A Shape can have many Spline Sub-objects. For example, in a Text object, each part of a letter is a separate Spline Sub-object.

Click the word Segment to enter Sub-object mode. It lights up in bright yellow to indicate that we’re in a Sub-object mode. As long as we’re in any Sub-object mode, we will not be able to select another object in the scene.

Press the S key to turn off 3D Snaps. Press the W key to activate the Select and Move tool. In the Front viewport, click on parts of the curve to select Segments, then move them to start shaping the proportions of the glass.


Move Segments to start shaping the glass

Switch to Vertex Sub-object mode and move some points around, too. Don’t move the first point away from its position at the origin. As for the last point on the curve, you can move it up and down, but don’t move it side to side. It is very important that the point at the bottom of the glass bowl is precisely positioned at an X value of zero. If the first and last points aren’t aligned properly, you’ll have serious problems with your model, such as holes in the surface.

It is common to accidentally move the end vertices away from their intended position of zero in X. It’s easy enough to fix: just select a vertex with the Move tool, and type a zero in the X field at the bottom of the screen. This is called the Transform Type-In area, and it works in conjunction with the Move, Rotate, and Scale tools on the Main Toolbar.


Type a zero in the X field of the Transform Type-In Area

Warning: If you try to use Snaps to fix the vertex positions, you’ll run into trouble. You won’t be able to make a vertex snap precisely to a grid point. The problem is occuring because the 3ds Max cursor isn’t snapping to the vertex at all. It will only work if you go back into the Grid and Snap Settings dialog and turn on the check box labeled Vertex. The cursor must snap to two things: the vertex you select, and the grid points.

3. Refine

Before we can do any real shaping of the curve, we’ll need to add more points to its structure. While still in Vertex Sub-object mode, scroll down in the Modify panel until you see the section labeled Geometry. Each of these sections is called a rollout, because it is collapsible. In the Geometry rollout, look for a button labeled Refine. this is the tool that lets you add new vertices to a line.

With the Refine tool active, click the inside of the glass bowl to create a new vertex at that location. Click again to create a new vertex on the outside of the bowl. Right-click to exit the Refine tool.


Line (Editable Spline) > Geometry > Refine

4. Vertex Types

Select the two vertices you just created. Right-click anywhere in the viewport, and the Quad Menu appears. This is a context-sensitive menu that gives easy access to the most common tools. In the upper left quadrant of the Quad Menu, look for menu items that say Bezier Corner, Bezier, Corner, and Smooth. These are the four different types of vertices on an Editable Spline.

There is a check next to Corner, because all of the selected points are Corner vertices. Click Smooth to convert the selected vertices to Smooth.


Right-click and choose Smooth in the Quad Menu

Now move the vertices in the Front viewport to edit the curve. Smooth vertices are often a good starting point, because they are simple. A spline always passes gracefully through a Smooth vertex. However, Smooth vertices don’t offer much control over the shape of the curve.

You can also convert points to Bezier, which will give you the additional control of adjustable tangent handles. These are displayed as green boxes in the 3ds Max interface. If you’ve used the Pen tools in Illustrator or Photoshop, you're already familiar with how Bezier splines work. It’s the same thing in 3ds Max, just with a different user interface.


Bezier points have tangent handles, Smooth points do not

Bezier Corner vertices also have tangent handles, but the two handles can move independently. They are not locked together like the handles of Bezier vertices.

Warning: Sometimes the Move Gizmo can actually get in your way. Notice that the Move Gizmo appears at the location of the selected vertex, not at the location of the tangent handle. This can get messy. If you have difficulty controlling the movement of tangent handles, you can turn off the display of Transform Gizmos. Press the X key on the keyboard. Now the Move Gizmo is hidden, and all we see is a red tripod that indicates selection.

Now, to choose which axes you wish to move in, use the hotkeys F5 through F8. These are the Axis Constraints. Press F8 to cycle through the XY, YZ, and ZX planes. Generally, you’ll want to move tangent handles in the XY plane of an orthographic viewport. Don’t forget to press the X key again when you’re finished, to turn the Transform Gizmos back on.

5. Fillet

3ds Max provides many time-saving tools. One of these is Fillet, found in Editable Spline. It’s located near the very bottom of the Geometry rollout. Click the Fillet button, then click and drag on a vertex to create an elegant curve segment.

You can also select multiple vertices, click the Fillet button, and click-drag on a selected vertex. This creates fillets on all selected vertices. An alternate method is to select one or more vertices, click the Fillet button, then enter a numeric distance in the field to the right of the button.

As with other tools on the Modify panel, right-click in any view to exit the Fillet tool.


Before and after using the Fillet tool

6. Curve Editing

Continue editing the spline curve until you have achieved a pleasing result. Here are a few guidelines to follow.

Make sure the first and last vertices remain at an X value of zero.

Don’t allow the curve to cross over itself at any location. Zoom in very close to all sharp corners, to check your work.

Resist the urge to add more vertices. Too many points will result in a jagged curve. If you’re trying to achieve flowing curves, then “less is more.”

It’s easy to remove vertices from the curve: just select them and press DELETE on the keyboard. However, this will change the shape of the curve, often quite drastically.

When you’re happy with the curve, delete the reference box that you created earlier. Save the scene. Don’t worry about trying to make the line absolutely perfect at this point, because you’ll still be able to make changes later.

Part Four: Lathe Modifier

1. Two-Viewport Layout

It’s a lot easier to edit the wine glass if we can see the Line in the Front view, while observing the resulting Lathe in the Perspective view. We don’t need the Top and Left views at all. So let’s configure the 3ds Max viewports.

Exit Sub-object mode. Go back to the four-viewport layout with the ALT + W keyboard shortcut. Right-click on the Perspective viewport label, at the top left of the panel. From the pop-up viewport menu, choose Configure. The Viewport Configuration dialog appears.

In the Viewport Configuration dialog, choose the Layout tab. Choose the two-panel layout. It’s near the upper left corner of the dialog. Then, click in the viewport image at the bottom left of the dialog, and choose Front. Click the viewport image at the bottom right, and choose Perspective. Click OK to exit the dialog.


Viewport Configuration dialog

2. Add the Lathe Modifier

With the line selected, press the Z key to frame the line in all viewports. Add a Lathe modifier from the drop-down list. It’s also found in the Main Menu, under Modifiers > Patch / Spline Editing > Lathe.

In the Perspective view, press F3 to see shading in the viewport. Then press F4 to view Edged Faces, or wireframes over shaded polygons. Now we can really see the model and how it is constructed.

When you first add the Lathe, the model will not resemble a wine glass. It will look like a jumbled mess of self-intersecting geometry. That’s because 3ds Max uses the Pivot Point of the line to set the location of the revolve axis. The Pivot Point is currently in the geometric center of the line, instead of at the world origin. So by default, the line revolves around the wrong location.

We could fix this in several ways. If we knew about it in advance, we could have snapped the Pivot Point to the origin before adding the Lathe. Or we could enter Axis Sub-object mode and move the axis manually. However, there’s a much easier way. Look in the Align section of the Lathe modifier Parameters, and click the button labeled Min. The axis moves to the location of the vertex with the minimum position value. In this case, there is a vertex at the origin, so the axis moves to that location.


Align: Min

3. Lathe Parameters

Before proceeding, make certain that the Lathe modifier’s Output is set to Mesh. We want to model a polygon mesh object, not a Bezier patch or NURBS object. Those other object types would result in a very “heavy” model, with too much detail.

Adjust the number of Segments in the Lathe modifier. For a closeup shot, we would need more detail in the geometry. The default is 16. Increase it to 32.

Orbit around in the Perspective view. Check the bottom of the glass and inside the bowl. Press F4 to turn Edged Faces on or off as needed. You’ll probably see strange triangles radiating from the center of the glass. Enable the Weld Core option in the Lathe parameters.


Enable Weld Core to fix this problem

You should not see any holes in your model. If there is a hole, then you have not properly snapped the Line vertices so they have an X value of zero. Likewise, examine the model closely in the Front view, to make sure there is no area where the surface crosses over itself. If you do see problems, you can fix them in the next step.

3. Fine Tuning

Now that we have a 3D object, we can make any final adjustments to the shape of the line. Click the word Line in the Modifier Stack to go down to the level of the line. Then enter Vertex Sub-object mode. Make your changes in the Front view, while observing the results in the Perspective view.


Line editing with Show End Result enabled

Sometimes it’s difficult to see what you’re doing in the Front view, because the Lathe wireframe gets in the way. Unfortunately, there’s no easy way to view only the line in the Front view, while viewing the Lathe in the Perspective view. There is a workaround involving a Reference Clone object, but that’s beyond the scope of this exercise. For now, we’ll have to be content with turning the Show End Result button on and off in the Modify panel. If it’s on, we can see the result of the entire Modifer Stack, including the Lathe. If it’s off, we’ll only see the current level of the Stack. So, if we go into Vertex Sub-object mode and turn off Show End Result, we can see the line without the Lathe.

4. Line Interpolation

Although we can set the number of radial Segments in the Lathe modifier, we still don’t have full control over the level of detail. To do that, enter the Interpolation rollout of the line. Adjust the number of Steps. Observe the result in the Perspective view, with Edged Faces enabled.

The Steps parameter sets the number of sub-segments between each two vertices on the line. The Steps parameter always produces the same number of sub-segments between two vertices, regardless of the distance between them. If vertices are spaced closely together, the level of detail will be higher in that region. If vertices are spaced far apart, the level of detail will be lower in that region.


Adjust the Steps within the Interpolation rollout

The Optimize check box reduces level of detail wherever the spline curve approximates a straight line. Unfortunately, there is no user control over the threshold for optimization. Generally speaking, Optimize should be enabled if the object is not expected to deform. If we did want to deform the object, perhaps with a Bend modifier, then we would need to disable Optimize.

The Adaptive check box automatically inserts detail in areas of higher curvature. However, once again, we don’t have any control over this process. So, I don’t recommend using the Adaptive option. Just enable Optimize, adjust the number of Steps, and edit the positions of vertices if necessary.

5. Final Delivery

Press the 7 key on the keyboard to see Statistics about level of detail. In this example, the glass has about 3,000 polygons. That should be more than enough for rendering an image of the glass. If the shot required an extreme closeup, we could increase the Steps and Interpolation parameters. If we were outputting to a game or virtual world, we would need to bring the polygon count down a lot — to about 100 polygons.

Save the scene to a new filename:
wineglass_02.max.

Finally, we’ll “bake” the model to a simple mesh object. This is to ensure maximum compatibility with other programs and with future versions of 3ds Max. Save the scene again, this time to another filename:
wineglass_02_mesh.max.

With the wine glass selected, right click in the viewport to get the Quad Menu. Choose Convert To > Convert to Editable Mesh. The Line and Lathe are deleted from the Modifier Stack, and we are left with a simple, raw Editable Mesh object. Save the scene again.

If we wanted to make changes to the Line or Lathe, we could go back to the version we saved before converting to mesh.

ليست هناك تعليقات:

إرسال تعليق