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

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

Search Media Workstation

Click here to search all Digital Media Net

 

 

 

 

BACK TO PAGE 1 2 3

Single morphed images

To manually create a single morphed image, move the "warp" slider to set the shape of the "tween" mesh, select the "Commands" menu within an image panel, and select the "Warp Image" button. Both images will be warped. Now move the "dissolve" slider to see the warped images.

To save a morphed image displayed in an image panel, select the "Commands" menu and select the "Save Image..." button. A dialog box will pop up asking for an image filename. Type in the name of the file you want use to to save the image. The image file will be written in the Targa TrueVision TGA image file format.


Morph sequence

Usually a morph is performed as a sequence of images which are later combined to form an animation. Xmorph automates this process.

  • From the "Morph Sequence" menu, select the "Set sequence name..." button. A dialog box will appear. Type in the text string you want to use as a prefix for all of the morphed image files, and press "Okay".
  • Again from the "Morph Sequence" menu, select the "Set sequence number of steps..." button. A dialog box will pop up asking for the number of steps to use. Type in the number of images you want for the morph. If you play the images at 30 frames per second and use 30 images, then the animation would last 1 second.
  • From the "Morph Sequence" menu, press the "Warp sequence" button. Xmorph will control the "warp" and "dissolve" parameters for each image, and generate all of the images for the morph sequence. The left Xmorph image panel will occasionally update to display the progress of the morph sequence. The image filenames will have the form "prefixNNNN.tga" where prefix is the sequence name entered in the "Set sequence name..." dialog box, and NNNN is an integer. The files will be in the Targa TrueVision TGA image file format.


Xmorph sets the values for the warp and dissolve parameters differently in time. The warp parameter changes linearly in time, but the dissolve parameter changes slowly at first, rapidly in the middle, and slowly at the end of the morph sequence. The reason for this is that the warping looks more plausible than the dissolving, so the dissolving is peroformed relatively rapidly in the middle of the morph sequence when both images are reshaped to about mid-way between the source and destination shapes.

An alternative way to generate a morphed images is to use the command-line program "Morph" which accompanies Xmorph. After the meshes have been generated, execute morph once for each image:

  • morph -start SRC_IMG -finish DST_IMG -src SRC_MESH -dst DST_MESH -mt WARP -dt DISSOLVE
where SRC_IMG is the source image filename, DST_IMG is the destination image filename, SRC_MESH is the source mesh filename, DST_MESH is the destination mesh filename, WARP is the warp parameter (between 0 and 1), and DISSOLVE is the dissolve parameter (between 0 and 1).

Animating the morph sequence

Xmorph morph animation To animate the morph sequence, a program other than Xmorph has to be used. Xmorph generates the morphed images but does not create a consolidated animation file. The reason for this missing feature is that there are simply far too many options for animations: MPEG (multiple versions), motion JPEG (many nonstandard varieties), animated GIF, QuickTime (many versions), many forms of digital video, and so on. Just as Xmorph leaves the task of image file conversion to other programs, Xmorph also leaves the conversion from images to movies to other programs.

Still, for the purposes of this tutorial, let's assume you have a Unix machine, the NetPbm utilities, and whirlgif. Convert each morphed image from TGA to GIF like this:

  • tgatoppm image.tga | ppmquant -fs 128 | ppmtogif > image.gif
Then combine the GIF images into a single animation:
  • whirlgif -o movie.gif -loop 0 -time 15 prefix*.gif

Since 1989, Dr. Michael J. Gourlay has been writing programs in C almost entirely on UNIX systems. He has worked on computer animations, image procesing, and scientific data visualization software both professionally and as a hobby. His Ph.D. is in physics in computational fluid dynamics and he has the coursework equivalent of a bachelor's degree in computer science. Although he's held the title of UNIX system adminstrator now and then over the past 9 years, his current position of Research Scientist with Colorado Research Associates involves visualization of large 3D data sets which rely heavily on volume rendering.

You can contact Dr. Michael J. Gourlay at 303-415-9701x203, fax:303-415-9702, or by e-mail at Michael.Gourlay@colorado-research.com. His home page is located at http://www.colorado-research.com/~gourlay.

Information on XMorph can be found at http://www.colorado-research.com/~gourlay/software/Graphics/Xmorph/.

BACK TO PAGE 1 2 3




© 2003, Digital Media Online, All Rights Reserved

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