3D Modeling Basics
FIGURE 3.0 This CyberDog model was created in 3D Studio R4 (DOS) using basic lofts and modified 3D primitives. Image ©1996 Mark Giambruno.
"At last!" The student sighed as he finished the day's spell book studies. "Now I can add some more detail to my castle project." He got up from his chair and stretched, then wandered over to the Glowing Pool to admire his work. Before him floated an impressive castle tower, its walls dotted with windows. He smiled at the fine roof, finally perched properly atop the turret.
"Not bad," the student said to himself. "I think I'll build an inner gate next...a wrought iron one." With that, he sat down to work. It was nigh on two hours later when the Master returned from his errands and approached to examine his student's work.
"Very good, lad," the Master remarked. "But aren't those iron bars usually twisted? Say, here and there?"
"Oh, I forgot about that. I guess I should have looked at the ones downstairs first." The student frowned thoughtfully. "Well, I can fix them easily enough." A few incantations later, the vertical iron bars were endowed with decorative twists.
"Now for the arched ones..." The student turned his attention to the bent iron bars that formed a decorative bridge between the vertical pieces. He spoke the Words of Deformation, but something went terribly wrong. The arches wrapped around themselves like Olde Gold pretzels!
"Aargh!" groaned the student, realizing the problem. "I can't twist them after they've been bent. The axis..."
"Quite so," interrupted the Master. "Seems you forgot one of the key principles of conjuring, lad," he sighed, tapping on a large wooden sign on the wall. It read simply:
Laying the Groundwork
As our hapless student just discovered, it isn't enough to know how to use a tool. You have to be able to see the project as a whole and plan a strategy for accomplishing it. Through theory and then tutorials, this chapter not only introduces you to the basic modeling tools, with tips on when to use them, but also offers suggestions for planning out the best modeling approach and developing good work habits.
The first step in planning any project is to sit down and decide exactly what you want to accomplish. For example, say your project involves animating two modern fighter jets in an aerial dogfight. Well, right off you know you're going to need 3D models of the planes, as well as imagery of the sky and ground to use for the backgrounds. Because we're dealing with modeling at this point, let's focus on one of the planessay, an F-14 Tomcat like the one Tom Cruise "flew" in the movie Top Gun. Because this is a fairly well-known craft, there's a good chance that others have already built models of this jet that you could find free or purchase for a fee on the web. I can tell you from working in a production environment that this is one of the first possibilities I check on when bidding out a projectit's usually a lot cheaper and faster to buy a complex model from a stock mesh outfit (or find a freebie on CD-ROM or the web) than it is to build one. The only downside is that stock mesh tends to have a high polygon count, and it's difficult to modify. Take a look at Chapter 4, "Modeling: Beyond the Basics," for more information on stock mesh.
At any rate, because we're here to learn about modeling, let's presume that you want to scratch-build the F-14 model. Now that you've identified the kind of plane you want to build, you're going to need some reference materials to serve as a guide. You may start off by searching for images from the web, going to the library or bookstore to find pictures and specifications, and even watching a few movies to study how they look in action. Ideally, you'll find some detailed line art of the plane that you can scan and load into your 3D program and use as a template. For more tips on finding and using reference materials, take a look at Appendix G, "Planning and Organization," which you can find on the CD-ROM.
NOTE
If you're trying to create a model and don't have a specific reference, you may want to build a massing model to help work out the proportions. A massing model is a highly simplified version of the model where you use rough forms as stand-ins for the finished ones. This simplified model should be very quick and easy to build, and enables you to experiment freely, scaling the major components up and down and shifting their relationships to each other. After you get an overall look you're satisfied with, you can use the massing model as a scale reference for building the finished components.
Now that you have a reference, study the plane. Identify the tricky parts, like spots where curved surfaces join together. Some of these areas may look a bit complex even to an experienced modeler, but remember that there's always more than one way to solve a problem, so if an aspect of the project seems particularly daunting, try to find a creative alternative.
Modeling Approaches
Whenever possible, take the simplest path to success when figuring out how a model will be constructed. The KISS (Keep It Simple, Stupid) principle applies very nicely to 3D work, because complicated models and operations tend to bog down the system and are more likely to cause trouble later on.
Bump and diffusion mapping (discussed in Chapter 6, "Texture Mapping") uses bitmapped images and normals manipulation to give the impression that there are additional mesh details on an object. Because of this, mapping can often substitute for lots of detailed mesh, particularly with objects that aren't the focus of attention or are distant in the scene. So, think about whether a texture could be used on a simpler object (even a single flat polygon) and still achieve satisfactory results.
In addition, think about how the model will be animated in the scene. If you never see the far side of an object, you may not need to bother modeling it.
If you're uncertain about whether a given modeling approach will work, do a test run with a quickly defined version of the object to find out. Experimenting in this way will often turn up alternatives that you may not have thought of otherwise.
Organizing Your Project
Before you start to build a model, take a little time to set up some directories (folders) to hold the files in an organized manner. I recommend creating a "3D Projects" directory and keeping all your original work in that, organized by the name of the individual project or model. In this case, you might call the subdirectory "F14 Jet." Inside that directory, create an additional folder called "Mesh" and another called "Maps." Then, when you go to build the model, you can save the 3D object files in the 3D Projects\F14 Jet\Mesh directory and the texture maps in the 3D Projects\F14 Jet\Maps directory. This will keep all the files related to the project in one easy-to-find directory. Keeping your files organized and grouped together this way also makes the projects easier to back up, because you don't have to hunt all over the hard drive to find the mesh and maps.
NOTE
When you start texturing your models, you may find that you'll often use images that came free with your 3D program. I recommend that you make copies of any of these that you use on a given model and put them in the Maps directory for that project. Not only does this enable you to customize the maps for your project, but it also ensures that you'll have all the files you need if you ever try to open the project on a different system (one that may not have all the stock maps installed).
Now that you have a place for all the files, what about the filenames themselves? Use a clear, descriptive name and add a number (with a leading zero) to the end so you can save off different versions as you work. F14Jet_01.xxx would be a good one to start with for the mesh file. Apply the same logic to the texture maps as wellF14 Canopy Glass.jpg, F14 Tire Tread.bmp, and so on.
Properly naming the hundreds of individual objects that may make up a model is also important. When a model starts to get complex, selecting parts by eye can be difficult. Also, there are situations when you have to choose from an alphabetized list of objects to perform some process on them. This will be pretty tough if your list of objects contains entries like Sphere27, Line155, and Cube82names that may be automatically assigned by the program as you create objects. Selecting from a list that includes items such as F14Rudder, F14WheelRight, and F14Missile03 would be a bit easier.
You'll find a more in-depth guide to object and file naming conventions in Appendix G, "Planning and Organization." I strongly recommend you read it before starting on any modeling project.
Modeler Concepts
Now that you've gotten organized, it's time to move on to the software itself. As you know, modeling is the process of creating objects with a 3D software program. The term modeler was defined in Chapter 1 as the person who performs this work, but it is also used to describe that portion of the 3D package that deals with object creation, as well.
Types of Modelers
NOTE
Portions of the following material dealing with 3D software information and reviews originally appeared in an article I wrote for InterActivity magazine (Copyright 1996, Miller Freeman, Inc.) and is used with permission.
There are four basic types of modeling systems: polygonal, spline, patch, and parametric. Many packages combine these systems because each has its strengths and weaknesses. Polygonal is the most basic, and deals with 3D objects as groups of polygons only. Spline modelers are more sophisticated, and allow the user to work with resolution-independent objects. Patch modelers are well suited to sculpting organic objects, and parametric modelers allow the parameters of an object to be changed later in the process for maximum flexibility. Although each program takes a different approach, many of them incorporate two or more of these different modelers for flexibility.
Polygonal Modelers
Polygonal modeling is the oldest type of 3D modeling, harkening back to the days when people had to define points in 3D space by manually typing in X, Y, and Z coordinates from the keyboard. As you know, when three or more of these coordinate points are specified as vertices and connected by edges, they form a polygon, which can have color and texture. When you put a bunch of these polygons together, you can fashion a representation of just about any object. A downside to polygonal modeling is that everything is made up of these tiny, flat surfaces, and the polygons need to be fairly small or your object may appear faceted along the edges (see Figure 3.1). This means that if you will be zooming in on an object in a scene, you have to model it at a high polygon resolution (density), even though most of the polys will be unnecessary when you move farther from the object.
FIGURE 3.1 With polygonal modelers, objects are constructed with polylines and polygons, the "native form" of 3D graphics. Polygonal modeling is very useful for creating low-polygon models such as the ones used in real-time games. After an object is created in this type of modeler, however, it can be difficult to increase its resolution.
NOTE
For consistency, all of the interface screen grabs in this book are from Discreet 3ds max 4.2. Like many 3D software offerings, max has several different modelers integrated into the package.
Because of the overall increases in processor and display speed over the years, 3D software began to migrate from polygon-based to spline-based modeling, and some packages practically ignored polygonal modeling completely. Interestingly, though, polygonal modeling has made a big comeback because of the incredible popularity of real-time 3D games, so more robust polygon editing tools have made their way into what were primarily spline-based products.
Spline Modelers
If you've ever used a 2D drawing program such as Illustrator or CorelDraw, you're familiar with splines, one of the main tools that these programs use. Technically speaking, a spline is a (usually curved) line that is defined by control points. One of the main advantages of spline-based modeling over polygonal modeling is that it is resolution-independent, meaning that (in theory) you can get as close as you want to an object and never see any faceting (see Figure 3.2).
FIGURE 3.2 Spline modelers, like the NURBS-based one shown here, use resolution-independent splines to define objects, and tend to produce smoother results than polygonal modelers. Also, the final polygonal resolution of spline-based objects can be adjusted at any time.
Spline modelers are well suited to creating complex organic shapes such as human faces, Tyrannosaurs, and alien spacecraft. Splines are often better for applications like this because their method of building forms uses smooth and natural curves, rather than jagged and artificial polygonal shapes. There are several different types of splines, with modelers commonly using the B-spline, the Bezier, and NURBS. Spline types and the differences between them are discussed later in the chapter.
Patch Modelers
Patch modelers use a network of control points to define and modify the shape of the patch, which is usually a lattice of either splines or polygons (see Figure 3.3). These control points, called control vertices (CVs), exert a magnet-like influence on the flexible surface of the patch, stretching and tugging it in one direction or another. In addition, patches can be subdivided to allow for more detail and can be "stitched" together to form large, complex surfaces. Like spline modelers, patch modelers are very suitable for building organic forms.
FIGURE 3.3 Patch modelers use magnet-like Control Vertices to affect the surface of an object, and can produce very smooth results. Like spline-based modelers, they are particularly well suited for organic modeling.
Parametric Modelers
Parametric modeling features objects that retain their base geometry information, such as their default shape, their current size, and how many segments their forms comprise. Because this information can still be accessed and changed even after the objects are modified, it allows the user to change or undo alterations to the object later on, and even increase or decrease its resolution (see Figure 3.4). Although parametric modeling is usually spline-based, not all spline modelers are parametric.
FIGURE 3.4 Parametric modelers are also spline-based, but allow operations to be adjusted or undone even after several modifications have been made to an object. Among other things, this enables the object's resolution to be adjusted after creation and modification.
Deformations applied to parametric objects can often be adjusted at any time, even though they may have been applied several operations ago. (The student in the opening tale could have benefited from this.) Contrast this to polygonal modeling, where after an object is created, its resolution is fixed (unless you tessellate or optimize it). Likewise, deforming a poly-gonal object permanently modifies it, so if you bend an object, then later want to reduce that bend significantly, you probably have to start over again with an unbent object.
NOTE
If a parametric model is destined for use outside the 3D programin a game, for examplethe model usually needs to be converted to a polygonal model. This is often referred to as collapsing the mesh.
The fact that so many different types of modeling approaches exist is another reason it's difficult to give specific instructions for the tutorials at the end of this chapter, which are designed to be program-independent. (Max, LightWave, and Maya-specific tutorials are included on the CD-ROM, however.) Although a spline or parametric modeler works best for the rounded organic forms in the tutorial, such as the helium bag, you can use a polygonal modeler as well, making sure that you set the mesh density to a reasonable level when you create the objects. Regardless of which type of modeler you have, however, all the tutorials can be accomplished in one way or another.