Category : Printer + Display Graphics
Archive   : DMORF11.ZIP
Filename : DMORF.DOC
Copyright (c) 1992, 1993, by David K. Mason.
All Right Reserved.
DMorf (Dave's Morphing program) is a small morphing program that
runs in DOS graphics mode. It operates on TGA, GIF, and IMG
files, and produces a bunch of TGA files as output.
You can compile these TGA files with my other program, DTA, or
dump 'em straight out to video if you've got the hardware.
----------------------------------------------------------------------
Hardware requirements:
To run DMorf, you MUST have:
1) A VGA monitor
2) At least a '286
3) A mouse with a microsoft-compatible driver
4) *some* extended memory (expanded memory is not
useful).
To accomplish any serious work with this program, you SHOULD have:
1) SVGA board with VESA in BIOS or with a VESA driver.
By default, DMorf will use the 640x480x256 mode. If you use the
/800 command-line switch it'll use 800x600 mode instead. The
/1024 command-line switch tells DMorf to use 1024x768 mode
instead.
2) A fast processor *and* numeric coprocessor... DMorf DRAGS without
a copro. Right now the 486DX is the best chip to have because the
coprocessor is integrated on the same chip.
(When the Pentium comes out, it should be fantastic because of
its optimized floating point instructions.)
3) *Lots* of extended memory, unless you're working
with teeny pictures.
This program runs in '286 protected mode, and allows
access to up to 16M of extended memory.
( During the warping process, DMorf creates a buffer
big enough to hold one entire picture, in RGBa (32-bit)
form. That means 256000 bytes if you're working with
320x200 pictures, or 1,228,800 for 640x480, or 1,920,000
for 800x600, or 3,145,728 for 1024x768. )
You can speed DMorf up quite a bit using the /PRELOAD command-line
switch... it loads copies of both pictures into memory at startup
thus when displaying, editing, or morphing, it won't have to read
the pitures from disk. Also, it causes some intermediate pictures
to be stored in memory instead of saved and loaded from disk.
This can save significant time, but uses a *lot* of memory....
multiply the numbers in the previous paragraph by 3 or 4.
----------------------------------------------------------------------
DOS-Extender Files
The DOS-Extender Files from the Borland Pascal compiler (DPMI16BI.OVL,
RTM.EXE, and DPMIINST.EXE) must exist somewhere in your DOS path,
or in the same directory where you keep DMORF.EXE.
... or DMORF will not work at all. These files are in the DMorf
archive.
If you've got an unsupported 286 processor (you'll know, because
DMORF will complain loudly), then you'll have to:
(1) disable any memory management software you have running
(like HIMEM.SYS)
(2) run the other program in this archive, DPMIINST, which will
configure RTM.EXE for your system
and then
(3) turn any disabled memory managment stuff back on
----------------------------------------------------------------------
Multiple versions:
DMorf 1.1 comes in two varieties: DMORF.EXE and DMORFNC.EXE.
Both versions can run in systems that either have or don't have
math coprocessors, but DMORF.EXE will run much faster on
systems with coprocessors, and DMORFNC will run faster
on systems that DON'T have coprocessors.
If you have a choice, use DMORF.EXE and a coprocessor.
Sorry, but because it uses a different method of representing
floating point numbers, DMORFNC.EXE will not be able to read
mesh files created with versions 1.0 and earlier of DMorf.
You could get around this by loading a mesh file into DMORF.EXE,
saving it in the 1.1 mesh file format, and then loading the
new mesh into DMORFNC.EXE.
----------------------------------------------------------------------
How to use DMorf:
To get started with DMorf, type "DMORF
The files can be TGA (16, 24, or 32, compressed or uncompressed),
Vivid IMG, or GIF. The two files don't have to be in the same
format, but they do have to share the same dimensions.
DMorf will then read and display the two pictures in side-by-side
windows. If you only supplied one filename, then it'll display
that picture twice. It scales them so they'll fit in the windows.
Then, it lays a mesh over the two pictures.
In this program, a mesh is represented by a bunch of horizontal
and vertical lines. The points where they intersect can be
adjusted.
Initially, there are lines on the four edges of the picture,
There are always the same number of mesh points defined in the
two pictures, though they aren't always in the same places.
To add a new line to the mesh, move the mouse cursor to the
border around one of the pictures (which one doesn't particularly
matter). Click the *right* mouse button at the point where you want
the line added. (If the cursor is on the top or bottom border, a
vertical line will be added, and if it's on one of the sides, a
horizontal line will be added.)
To move a vertex, put the mouse cursor over the intersection
of two lines, press the button, and move the mouse.
Let go of the button when you've got the point where you want
it. DMorf will try to prevent you from overlapping lines.
It's possible to defeat it with weird angles. Don't do that...
it's bad.
The point of these meshes is to define the shapes of the objects
in the pictures. The lines should match the contours of any
objects in the scenes.
Move the vertices of the lines so that the lines match the curves
of the objects in the pictures. When you've got meshes that you're
satisfied with, click on the "Go" button and watch.
After you've saved a your mesh in a .MSH file (using the Save or
SaveAs button), you could start DMorf by just typing
"DMORF MESHFILE.MSH". DMorf will remember the names of your
picture files and any settings particular to your morph
sequence.
----------------------------------------------------------------------
The User Interface:
(note: also take a look at WHATSNEW.DMO... that file is sometimes
more up-to-date than this one is)
Here's what the other controls on the screen do:
The Save button: saves your meshes and settings to a control file.
It doesn't prompt for a filename unless this is a new mesh.
The Save As button: same as Save, but always prompts for a filename.
The Load button: loads a control file. Always prompts for a filename.
The Reload button: re-loads the current control file. Doesn't prompt
for a filename unless none is currently loaded.
The Quit button: Changed my mind. Get me out of this program NOW.
The escape key does the same thing.
The Go button: causes DMorf to start morphing.
The About button: gives DMorf copyright info.
The Colors button: switches to the Colors dialog.
The Pictures button: switches to the Pictures dialog.
The Settings button: switches to the Settings dialog.
The Swap button: swaps the meshes between the two windows.
The Max buttons: display just one of the images, much larger.
This gives much finer control over the mesh control points.
The Edit buttons: load one of the pictures into memory, display
it larger, and allow editing of the pixels' alpha values.
The Del button: lets you delete a line from the meshes.
The 1->2 button: copies the mesh from window 1 into
window 2.
The 2->1 button: copies the mesh from window 2 into
window 1.
The FlipH buttons : flips one of the meshes horizontally.
The Splines button: gives you a preview of what splines for the
current mesh points would look like. If you're using
"Spline meshes" mode, make sure you use this button once in a
while to make sure the splines aren't going nuts.
The Hide button: shows the pictures without any mesh superimposed.
(Settings:)
The Frames control: tells DMorf how many pictures to create.
If you're in Morph mode, then this represents how many tween
frames to create. In warp mode, this number includes a
fully-warped final frame.
First: specifies the first frame to actually render in the range
0 to Last
Last: specifies the final frame to render in the range First
to (Frames-1)
Warp 1/2: determines the speed of the warping portion of the
morph. Specifically, the number determines at which percent
of the morph the warp should be half done.
Fade 1/2: determines the speed of the fading portion of the
morph. Specifically, the number determines at which percent
of the morph the fade should be half done.
Spline meshes:
When your points are all located where you want them to be,
and you tell DMorf to go ahead and morph, DMorf figures out
which points to map where by drawing spine curves between
the vertices.
If you turn this control off, it'll draw straight lines instead.
Reasons to use splines instead of lines: the warp often looks
a whole lot better.
Reasons to use lines instead of splines:
(1) Splines sometimes go haywire, with curves going every which
way, overlapping, and (gasp) sometimes even passing beyond
of the picture borders
(2) You don't want something curved when it warps
(3) lines are faster than splines.
Spline Always:
Because it takes so much longer to display splines than it does
to display lines, DMorf usually just displays lines and waits for
you to click the Splines button to show what the splines look
like. If you check off Spline always, DMorf always shows the mesh
as splines.
Just Warp: In Morph mode, the program will map points from
picture #1 toward picture #2, and from 2 toward 1, and
cross-fade. In Warp mode, it'll just map points from
#1 toward #2, with no fade.
Not too surprisingly, Warp mode takes half the time
that Morph mode does.
Smooth resampling: In smooth mode, DMorf interpolates
new pixel values from all source pixels that should
contribute... if you turn this control off, it just
grabs a the closest pixel value.
Nearest neighbor, in other words. The results
in smooth mode look massively better than dumb mode.
But dumb mode is massively faster. Dumb mode would be
useful in test runs, but don't use it for real stuff, 'cause
it looks like crap.
Show In-between: DMorf usually displays, while morphing, all the
intermediate pictures it creates. If you turn off this switch,
it won't, and it'll finish quicker.
Verbose status: DMorf usually displays the frame number it's working
on, plus the percentage that it's finished of the frame. With
verbose status switched off, it lists only the frame number.
(In the Pictures dialog)
The Before text box: Specifies the name of the picture to morph
from.
The After text box: Specifies the name of the picture to morph to.
The Background text box: specifies a picture to overlay the morphed
frames onto (assuming they have transparency). This text box
currently doesn't do anything at all... in the future, when DMorf
shells out to DTA, it'll use this value to build the DTA
command-line.
The RLE Checkbox: Tells DMorf whether or not to create run-length
encoded (compressed) TGA files.
Compressed TGA files are almost always smaller than
non-compressed, but some programs can't read them.
(DTA can)
The 32-Bit Checkbox: Tells DMorf whether to create 24-bit or
32-bit TGA files. The only reason you might want to
use 32-bit TGA files is if you're planning to do compositing.
Some programs can only read 24-bit TGA files. (DTA can read
either)
The Bottom-to-Top Checkbox: Tells DMorf whether to create
TGA files that begin at the bottom of the screen, or at the
top of the screen. Some programs can only read one or
the other variety. (DTA can read both, but prefers bottom-to
top)
(In the Colors Dialog)
The Mesh colors controls: sets the red, green, and blue components of
the color used to display the control mesh.
The Alpha colors controls: sets the red, green, and blue components of
the color used to represent pixels that are more than 50%
transparent.
The gamma controls: The "File" value specifies the gamma correction
value that's already been applied to the picture. The "Disp"
value specifies the new gamma correction value for the screen.
(Note: gamma correction is a gimmick for adjusting the brightness
of a picture.)
If all this makes no sense, just start messing around with the
program. Once you figure out how to add new points to the mesh,
the rest of the interface is pretty intuitive.
----------------------------------------------------------------------
Credits:
The warping, morphing, image scaling, and spline algorithms all
come (with modification) from George Wolberg's excellent book
Digital Image Warping. The user interface stuff is all mine.
Thanks to Michael Day (Knight Software) for making his VESA
BGI graphics driver (BGI256) available.
Thanks to Lutz Kretzschmar for letting me use his SVGA
mouse-handling code.
Thanks to the Compuserve GRAPHDEV forum gang, and the Graphics
Alternative BBS gang for their suggestions, and various bugs
they've helped me identify.
Thanks to Eric Deren for his neat ideas on manipulating meshes.
----------------------------------------------------------------------
Disclaimer:
If you use DMorf, you do so at your own risk. I won't be held
responsible if it screws anything up.
----------------------------------------------------------------------
Support:
If you've got any requests/bug reports/suggestions, send a message
to:
"David Mason" on the "You Can Call Me Ray" BBS, (708) 358-5611,
and on "The Graphics Alternative", (510) 524-2780,
and on "Channel 1" BBS, (617) 354-8873.
"76546,1321" on Compuserve.
You'll probably get some kind of a response (maybe sooner, maybe
later)
----------------------------------------------------------------------
The Rules:
Feel free to re-upload this program to other bulletin board
systems in its *original, unmodified* form. You may not
repackage it with other software. You may not repackage it with
your own tutorial. I feel like an idiot having to make these
demands, but people have been doing these things.
Do not include this on a disk along with any magazine,
book, hardware product, or other software product without my
permission.
----------------------------------------------------------------------
Money matters:
DMorf is a shareware program. If you think this program is worth
it, send some money or some computer hardware or something to:
David K. Mason
P.O. Box 181015
Boston, MA 02118
I think $35 is an appropriate amount, but feel free to send more
or less.
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/