Powering Digital Media Production ... Return to Media Workstation Home Page

Shapeshifter: An Xmorph Tutorial (page 3)
by Dr. Michael J. Gourlay

Search Media Workstation

Click here to search all Digital Media Net

 

 

 

 

BACK TO PAGE 1 2 CONTINUED ON PAGE 4

Manipulating meshes

The main purpose of the image panels is to provide a way to manipulate control meshes. Drawn over each image are meshes. These meshes indicate features of each image which corresponds to features of the other image. This concept will be explained below by example.

There are three different meshes: The "source" mesh, the "destination" mesh, and the "tween" mesh. The user can manipulate mesh points in the source and destination meshes. The tween mesh, however, is a slave to the other two meshes, and is always somewhere between (hence the name "tween" mesh). The three different meshes each have a different color. Usually, the source mesh is green, the destination mesh is red, and the tween mesh is yellow. (It is possible, however, that other colors are used to designate the meshes, because Xmorph has a feature that allows people who are red-green colorblind to use other colors. This feature is explained in the Makefile, which is used to compile Xmorph.)

The objective is to manipulate the meshes to match features between the source and destination images. Mesh operations include adding and deleting horizontal or vertical mesh lines, and moving mesh points. The table shows what mouse and keyboard buttons to press to perform these operations.

move mesh point click with left mouse button, drag to new location, release mouse button.
add vertical mesh line click on image with middle mouse button
add horizontal mesh line click on image with right mouse button
delete vertical mesh line hold "shift" key, click on mesh point with middle mouse button
delete horizontal mesh line hold "shift" key, click on mesh point with right mouse button

One issue to be aware of is which mesh is being manipulated. Note that each image panel has two sliders: warp and dissolve. The warp slider controls the tween mesh, which (as noted earlier) always lies somewhere between the source and destination meshes. Initially, the left image panel has the tween mesh set to the source mesh, and the right image panel has the tween mesh set to the destination mesh. The tween mesh position in each image panel controls which mesh is manipulated. If the tween mesh in a particular image panel is closer to the source mesh, then in that image panel the source mesh will be manipulated by the mouse controls listed in the table. Likewise, if the tween mesh in a particular image panel is closer to the destination mesh, then in that image panel the destination mesh will be manipulated by the mouse controls listed in the table. When moving mesh points, the mouse cursor will change colors to indicate which mesh (source or destination) is being manipulated.

Notice that when a mesh point is selected for being moved, it is highlighted in both the source and destination image panels. This makes it easier to identify how mesh points correspond to each other in the two images.

For example, a very rough approximation in the person/alien example would be to use one mesh line to deliniate each of the following features: the top, bottom, left and right of each head, and the top, bottom, left and right of the image frame. Such a mesh would have 4 vertical and 4 horizontal lines, and would vaguely match the outline shapes of each head during the morph. This would yield a very unsatisfying morph, however, since the mesh lines would not fit the head shapes very well, and other features, such as the locations and sizes of the eyes, lips, ears and nose would not match.

Xmorph main window with two faces with meshes A more refined approach is to identify features which should match, and use four mesh points to roughly surround each feature. For example, in addition to having a mesh line at top, bottom, left and right of the head outline, also add a vertical mesh line for each eye, two vertical mesh lines to go on the left and right of the nose, and a vertical mesh line for the border between the hair and skin on each side. Also add a horizontal mesh lines for the hair line at the top, the eyebrows, the top and bottom of the eyes, across the nostrils, above and below the lips, at the chin line and at the shoulders.

Morphing images

Images can be morphed manually individually, or automatically as a sequence. Usually the automated morph sequence would be used to produce an animated morph, but manually morphing individual images gives the user more control over the morph parameters, and is useful for generating single in-betweener images, such as if you wanted to speculate on what a hybrid of two people might look like.

Read the source and destination images create the meshes before performing any morphing.

Xmorph main window with two warped facesThere are two controls for creating a morphed image: "warp" and "dissolve". "Warp" controls how much the shape of each image is altered. "Dissolve" controls the cross-fade between the two warped images. These two processes combined constitute a "morph".

The warp part of a morph changes the shape of the images. The shape of both images is determined by the mesh associated with the original image, and the tween mesh. For example, the original shape of the "source" image is described by the "source" mesh, and the original shape of the "destination" image is described by the "destination" mesh. The "tween" mesh described the final shape of both images. In this way, the shape of both images is brought into the same shape, which is the shape described by the "tween" mesh.

For example, if the tween mesh is set to the shape of the "source" mesh (i.e. if the "warp" slider is all the way to the left), then when the "source" and "destination" images are warped, the "source" image will be unchanged and the "destination" image will be reshaped into the shape described by the "source" mesh. Likewise, if the tween mesh is set to the shape of the "destination" mesh (i.e. if the warp slider is all the way to the right) and the images are warped, then the destination image will be unchanged and the source image will be reshaped into the shape described by the destination mesh.

BACK TO PAGE 1 2 CONTINUED ON PAGE 4




© 2003, Digital Media Online, All Rights Reserved

  home      search      user forum      subscribe      media kit      contact       webmaster@digitalmedianet.com   Return to Media Workstation Home Page