Meshwork Manual


[ Overview ] [ Topics In Depth ] [ Reference ] [ Tutorial ]

2. Topics in Depth

In this section, we will discuss several topics which may be particularly troublesome to new users of Meshwork or other 3D modeling software.


2.1. Editing Complex Models

Several sources of difficulty arise when editing a complex 3D model on a 2D screen. These include:
  1. difficulty telling near points from far points
  2. accidentally selecting the wrong points
  3. difficulty visualizing 3D structure
The first two items are handled most neatly by making extensive use of the Show/Hide commands. Consider, for example, figure (a) at right. It shows the head of a 3D figure, viewed from the front with "draw faces" turned off. The edges at the back of the head appear to overlap with those in front, resulting in a complex mess. In some cases, the vertices actually do overlap, making it very difficult to select the desired point.

The solution is to hide the part of the model you're not working on. Suppose we need to work on the front. In (b), the model is viewed from the side, and the back part of the model is being selected. The Hide Selected command is then used to hide these points and vertices in (c). Returning to the front view in (d), only the front edges and vertices are drawn in black and can be selected. This allows us to work on the face without danger of damaging the back of the head.

(a) (b)
(c) (d)
Hiding the back faces of a complex object. (a) A 3D head shown in wireframe mode from the front. (b) The same model viewed from the side; the back part is being selected. (c) The back part has been hidden. (d) The resulting view from the front.
Note that the hidden parts are not completely hidden; they are drawn in a light blue color. Sometimes the hidden edges are actually drawn over the unhidden ones. If this appears confusing, try zooming in on the part of the model you're working on. This will minimize the overlap of hidden lines, and will also make it easier to select the desired vertex when two vertices appear close together.

You can zoom in on (magnify) your model in two ways: either use the zoom buttons (right), or click with the center tool () while holding down the command key.

There's one other trick for editing complex models: do it in parts, then attach the parts together. For example, if your model has bilateral symmetry, you could use the symmetry buttons to create both sides at once. But it might be easier to just create one side, then duplicate, flip, move into position, and attach. To attach, first use the Find Overlaps command (in the Vertex Menu) to select all the pairs of vertices within a specified distance; then use the Combine Overlaps command to combine each pair into a single vertex. A similar approach could let you edit limbs in a separate document, then attach them to a body.


2.2. Texture Mapping

Texture mapping is the process of applying a pixel image to the surface of a 3D object. Every point on the surface of the object (in x,y,z coordinates) must be mapped to some point (in u,v coordinates) on the texture image. There are two main approaches to this problem. First, you can simply store an arbitrary u,v texture location for every vertex in the model. Second, you can use some function to automatically "wrap" the texture around the model. Meshwork uses the second approach.

To illustrate, let's use the peanut-shaped object shown at right. (Incidentally, this was created by drawing a set of edges to form the profile, then using the Lathe command.) In the material properties dialog, we can pick one of three types of texture mapping: Planar, Cylindrical, and Spherical. All three types are fit to your model by clicking the "Set" button in the material dialog; this centers and scales the map to just cover the model (or more accurately, the currently selected parts of that material). Then click one of the map types.

Planar Texture Mapping

In planar mapping, the u,v texture location for any point is found by simply discarding the X, Y, or Z axis. Picture the texture as a solid core, with each pixel of the texture map forming a straight column running perpendicular to the chosen axis. The object is then carved out of this core.

The texture sketch (left) in a planar mapping looks much like viewing your model from one of the standard camera views. Superimpose this image on a texture, and you can readily see how the texture lines up with the model. The result of a planar mapping along the Z axis for our peanut is shown at right. From the front, the texture looks exactly as it was drawn, but on the sides, top, and bottom, stripes appear where the texture is stretched across the model.

Cylindrical Texture Mapping

A cylindrical texture mapping wraps the texture around the object like the label on a soup can. The u,v texture coordinate of any point is determined by its angle around the chosen axis (in our example, the Y axis).

Our peanut is radially symmetric, so the cylindrical mapping produces a nice regular texture sketch (left). As a result, the texure on the final object (right) wraps smoothly all the way around the object, with the only distortion at the very top and bottom.

Note the long diagonal lines running from the very left side of the texture sketch to nearly the right side. These are an artifact of the texture sketch, and do not reflect the actual mapping. The problem is that with cylindrical or spherical mapping, the texture folds around to touch itself. Points at the very edge really have two coordinates, one for the left side of the texture and one for the right. When Meshwork saves your file, it actually doubles some of the points in your model and attaches them to whichever side is most appropriate. But the texture sketcher does not do this, so you get these running-across-the-sketch artifacts. Just ignore them, and remember that those faces actually extend to the right.

Spherical Texture Mapping

Spherical mapping is very similar to cylindrical, except that the u,v coordinates of any point in space are determined by not only its angle around the chosen axis, but also its elevation relative to that axis. In other words, the texture is mapped onto a sphere, which is then "shrink wrapped" onto your object.

As you can see in the texture sketch, this has the general effect of given a little more area on the texture map to areas near the "poles" of your object, and a little less area to the middle. This reduces distortion near the ends (poles), especially for objects that are roughly spherical. The difference may be subtle, depending on your geometry. Comparing this result (right) to the cylindrical mapping, you can note two main differences: the grid (which is square in the texture map) appears more regular in cylindrical mapping, but there is also more distortion near the poles.

A final note about texture mapping: Use it efficiently! If some parts of your model are solid color, don't use a texture map for them; just set the material color. You can have up to eight different materials in one Meshwork object, so separate the solid-colored parts from the textured parts, and make every texture element count.


2.3. Using Bones

Bone-based mesh deformation is the modern way to make animated models, especially for character animation. The principle is fairly straightforward. In addition to the geometric data, the model includes a skeleton of bones, arranged in a tree structure -- that is, each bone is attached to a parent bone, and may have a number of children bones attached to it. Vertices are then attached to the bones, so that when the bones move, the mesh deforms appropriately.

A specific example may help illustrate the concept. Consider your arm. The upper arm bone is attached to the shoulder. The lower arm is attached to the upper arm. The bones of your hand are (roughly speaking) attached to the lower arm. When you move the upper arm, the lower arm and hand must move as well, because those are located in the bone hierarchy below the upper arm. The reverse is not true: you can move your hand without affecting the upper arm at all.

Real bones have an attachment point, a length, and a diameter. But the length and diameter don't matter in computer modeling; all we really care about is the attachment point. That's the point about which the bone rotates, and therefore, it's the point about which any attached vertices rotate as well. So in Meshwork (and most other bone modeling systems), bones are drawn not as little bone-shaped cylinders, but as points. Actually, they're more like little green spheres -- they're actually closer to joints than to bones, but the term 'bone' has become standard.

Every bone in Meshwork is identified with a four-character code. These characters can be anything you want, but a recommended set of bone codes for humanoid figures is shown at right. (Of course, many models will not implement all of these bones; but when you make a bone that does roughly match one of these descriptions, using the standard code will help ensure compatibility with others' animation files.)

When you add a bone (using the Add Bone tool), you give it a four-character code, and also enter the four-character code of its parent, if any. For the "root" bone(s), not attached to any other bones, the parent is 'None'.

The general strategy is to first develop your model geometry. Then add the bones. Finally, select groups of vertices and attach them to the bones using the Set Bone command.

Standard Humanoid Bones
Bone	Parent	Description
----	------	-----------
FotL	 LLgL	foot, left (hinged at ankle -- optional)
FotR	 LLgR	foot, right
LLgL	 LegL	lower leg, left (hinged at knee)
LLgR	 LegR	lower leg, right
LegL	 Hips	upper leg, left (hinged at hip)
LegR	 Hips	upper leg, right
Hips	 LBak	pelvis (optional)
LBak	 None	lower back
UBak	 None	upper back
Neck	 UBak	neck
ShlL	 UBak	shoulder, left (optional)
ShlR	 UBak	shoulder, right
ArmL	 ShlL	upper arm, left (hinged at shoulder)
ArmR	 ShlR	upper arm, right
LArL	 ArmL	lower arm, left (hinged at elbow)
LArR	 ArmR	lower arm, right
HndL	 LArL	hand, left (hinged at wrist -- optional)
HndR	 LArR	hand, right
Once you've assigned all the vertices to bones, then what? The answer depends on how the model is to be used. Bone-based mesh deformation is not part of QuickDraw 3D and there are no standard formats, so it will generally take custom tools to make use of this information. Bone structure and vertex assignments are stored in the
Meshwork file, an open format. You can also export to a Magdef bones file, for bone animation directly in Magdef, or to simplify converting to other formats.


Meshwork Manual Section 2: Topics In Depth
Last modified: 2/03/99