home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 12
/
CD_ASCQ_12_0294.iso
/
news
/
2391
/
form03
/
docs
/
form.doc
< prev
next >
Wrap
Text File
|
1994-02-02
|
9KB
|
214 lines
Sections
LEGAL STUFF AND COPYRIGHT
OUTPUT formats, and historical digression
POV
PLG
VIVID
Tools Used
BORROWED, BEGGED AND STOLEN SOURCE CODE :-).
TECHNICAL INFORMATION
REGISTRATION (Part 2)
CREDITS
For command line switches see OPTIONS.DOC
For an introduction see TUTOR.DOC
For new features see WHATSNEW.DOC
LEGAL STUFF AND COPYRIGHT
The FORM program is not public domain software. It is copyrighted
software, Copyright (C) 1993,1994 Andrew Rowbottom. It is however
free software, or what some people term 'Freeware'. You may use it
for whatever you wish, even using it to produce commercial pictures,
animations, sculptures, deep sea diving equipment, etc. You may NOT
however re-distribute modified versions of the executable nor
distribute any of the files in this distribution for a profit.
Any files in this distribution that contain a Copyright message are
copyright, and may not be used as the basis for any further work,
except for personal use. The images generated from input files
containg a copyright message are copyrighted to the author named in
the file.
None of the files in this distribution may be distributed with a
magazine, or a book without the the permission of Andrew Rowbottom.
Since this software is free, it is supplied WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. It is supplied as is, in the hope the people will
find it useful.
OUTPUT formats, and historical digression
When form was originally written it was designed to output text
files for input to POVRAY and to REND386, this used to be the only
way to actually see what had been created, but I got fed up with the
low quality of display from REND386 (although there is a lot to be
said for truly real time display), and didn't have the patience to
wait for a raytrace from POV every time, so I built in the screen
display that you have seen and now I use it all the time.
POV output
Pov output from FORM goes to a file temp.pov. The output file is
(usually :-) suitable for raytracing using the formvue2.pov sample
file. The form is always scaled so that it fits inside a unit box for
ease of placement. You can input textures inside FORM but you will
probably want to edit the output file to fine tune the textures.
FORM can now output declares for the primitives allowing you to
substitute your own shapes for the inbuilt primitives. This was a
suggestion from DAN FARMER and xxxx.
PLG output
PLG output from FORM goes to a file temp.plg. The output file is
suitable for input to rend386 (sometimes known as DEMO3 or DEMO4).
This output is crude and not optimal at all. REND386 does give a fast
real time display, but a problem I have had is that if the form
starts getting complicated (which they do very rapidly) bits start to
disappear from the screen.
VIVID output (implemented for John Beale)
John requested VIVID output, and since I used to think VIVID was
the bees knees I've implemented it. It's a bit clunky but it is
functional. Testing the output from this sidetracked me for a week
looking for a "bug" in VIVID that wasn't there, or anywhere for that
matter (a virtual bug!). That'll teach me to accuse other peoples
programs of mistakes!
Motive
The FORM program was started in April '93 as an excercise in
using C++ and LEX and YACC it has grown from it's original modest
intentions.
TOOLS USED
The code was originally developed under DJDelories Gnu C++, but I
changed to Borland's C 3.1 compiler, debugger and profiler. The
source code has been kept under control by MKS RCS, which has saved
the code from being completly lost twice so far. I use GNU's FLEX and
BYACC, although I have had to modify the code to FLEX to provide
include file capability and fix other minor incompatibilities.
BORROWED, BEGGED AND STOLEN SOURCE CODE :-).
Since I hate re-inventing the wheel I have in the course of this
project used code from Graphics Gems (the source code not the book)
and xxx's SVGAKIT. The Graphics Gems code proved a great source of
inspiration, and a good stepping stone to developing customised
algorithms since I could see if the idea worked first and then
rewrite for integer arithmetic.
SVGAKIT on the other hand is used practically as is. A very
useful package for IBM PC programmers.
TECHNICAL INFORMATION
I have rigged the code so that integers are used for most of the
drawing, giving somewhere around a five times increase in speed
compared against using floating point operations on a non 486. There
was a slight loss in quality, (try a single sphere at 320x200 res)
but it was worth it. I may improve the quality since I now know what
causes it, much rewritten code later! Some improvement in quality
has now been made in V3 , and I don't intend to change it any more except
for bug fixing.
The drawing method used is a simple polygonal ZBUFFER algorithm,
with gouraud shading. The polygons are rendered using integer
algoritms, including the depth, and intensity fields.
All other calculations in the system are performed using single
precision floating point.
Dos memory is used for the Zbuffer unless there isn't enough at
which point EMS memory is used. Failing that XMS memory is used,
this is copied to and from a single 64K cache in standard DOS memory.
This use of XMS is not the fastest possible, but what the heck -
it works!
A disk Zbuffer has now been implemented and appears to work. (Oh for
FLAT virtual memory!)
If you want to see how long form takes to parse a file run with
the command line flags "-display- -plg- -pov-", no output is
generated, and so the time taken is simply the load and process time.
For those of you who are really interested the TGA file is
uncompressed with a 256 colour palette. It's only TGA because that
was the easiest. GIF is now my standard (ta fractint).
REGISTRATION (Part 2)
Personally I hate readme's that either don't tell you how to
register (or even if you should), or give you half a book on the
subject right at the beginning. This program is free, give it to your
friends if you think they may like it. I don't charge anything for
this program, it costs nothing, and is warranted to no purpose except
that it will occupy some space on your hard disk/floppy until
deleted. You get what you paid for.
PS. If no-one sends me e-mail, I'll conclude that this program is
rubbish and probably stop development.
PPS. Thanks to all those who sent email. Don't stop sending it or I
won't develop mutations!
CREDITS
The code for this program came from many sources,
UNIVESA and SVGAKIT came from Kendall Bennett.
FLEX the lexical analyser came from the GNU project
BYACC came from heaven knows where.
The GIF encoder is a very mutilated version of the one in
Fractint. Thanks to the stone soup team, for making their source
freely available. ( and for sstools.ini , you should see the
junk in mine!)
Thanks to the people who published code from Graphics Gemsxxx.
While very little of their code finally ended up in FORM many of
the display routines were originally tested using their code. The
Graphics Gems collection was a real godsend and should be in your
source code collection. It can be retreived from wuarchive.wustl.edu
somewhere in \graphics\graphics.
PANTEK Ltd for allowing me to release this code.
Stephen Todd and William Latham for the inspiration and a good book.
Andrew Pearmund for providing a much needed get_pixel function
without which FORM couldn't save any pictures, and for breaking
the program it every time I showed it to him.
Sue Cunningham for being with me, and constantly praising my
feeblest efforts at creativity, and finally showing me the sort
of form that could be created! I still feel shocked looking at
them. Most of her forms are included with release 3.00.
Robert Fargher for being the ONLY person who sent me a FORM,
and for praising FORM.
Thanks.
Dan Farmer for many suggestions and encouragement.
Thanks also.
All the rest of you who wrote, it's given me great encouragement.
rummy@snaffle.demon.co.uk
Andrew Rowbottom