VERSION 1.0 - Released on August 25, 1997

   The purpose of this program is to easily create three dimensional sphere's
out of flat-planer polygons for use in programming, mathematics, engineering,
and game developement.

   No special installation is required.  Simply copy these files into the
directory of your choice.

README.TXT   - This file
POLYSPHR.EXE - The only usable executable file  (no command line arguments)
BRUN45.EXE   - Required to be in the same directory or in a CONFIG.SYS path
SAMPLE.WLD   - A sample output file made with the default input  (see below)

   This is freeware.  This is the first program I have written that merits
release on the Internet, even if it will only make a big difference in a few
people's lives.  If there are on-line forums you are involved in that pertain
to this sort of thing, e-mail me and let me know, I would love to be involved.

**** YOU MAY FREELY DISTRIBUTE THE ORIGINAL ARCHIVED FILE OF THIS PROGRAM ****

   This program was originally made to make the task for game programmers who
chose to use polygonical objects to represent spherical shapes (ie. for space
simulations, the stars, planets, moons, etc.) much easier, very flexible, and
far more accurate than trying to chart it by hand on graph paper and then try
and enter in the vertices one by one.  I have found through college and on the
Internet that this program has many uses in mathematics, engineering, other
areas of programming, computer graphics and art for use in motion pictures,
and so on.


The four (4) variables that will be prompted for during execution:

Precision       Depending on what data type you are using (char, int, long,
                float, double, or long double) you can specify the precision
                or, more specifically, the range of numbers (and in turn, the
                memory) that you want the program to utilize when storing the
                vertices.

                Since, for example, the data type "char" only supports a range
                of -127 to 127 (but only requires then 6 bytes per vertex), the
                precision variable you would want to give the program is a
                maximum of 127.  However, you will find that since you must do
                a scale factor then in your program, you may find it easier
                to use a precision of 10 or 100 for simplicity's sake.

                NOTE: THIS MUST BE A POSITIVE, NON-ZERO VALUE!

Lines of        This would specify the subdivision of the sphere into equal
Latitude and    lines identical to those that we use on navigational charts.
Longitude       The minimum is 3 lines of longitude (lines that extend north
                to south) and 1 line of latitude (lines that circle the globe
                parallel to or in place of the equator).  Using the minimums
                will give you more of a double pyramid looking object.  Using
                the actual 36 lines (10 each) of longitude and 18 (10 each)
                of latitude will give you a very smooth representation of
                a sphere from any distance.  Add shading (even flat shading)
                and the results are impressive.  Add texture mapping and you
                in addition to flat shading and you will be shaking in your
                boots.  I have not experimented with Gouraud or Phong yet,
                let me know if those effects are noticable.

                NOTE: THESE VALUES MUST BE NON-DECIMAL (INTEGRAL) VALUES.

Data Type       You can specify the data type you intend to use.  For example,
                if you are using the "long" data type, you can specify
                a high precision value without getting the non-integer values
                that a decimal point would impose.  On the other side of the
                coin, you could use polar coordinates (-1 to 1) but with a
                "float" or "double" or "long double" data type output.


The two (2) constants:

File Name       It will save to the directory from which it was executed in
                as NEWSPHER.WLD.

File Format     For those of you familiar with the books called Build Your Own
                Flight Sim in C++ or Gardens of Imagination, this WLD format
                will fit right into your programs (you need to add the lines to
                specify the lighting at the beginning and the convex flag at
                the very end).  For those of you using other sources or perhaps
                even making your own engine, the format is very straight
                forward and should be easy to load.  The format is as follows:

                Number of vertices,
Each vertex =>  x, y, z,
                Number of polygons,
Each polygon => sides, vertex1, vertex2, vertex3, [vertex4, ...], color,

                The sides field includes the side needed for closure
                The vertex fields reference the associated vertex from above
                so that if you need to do three dimensional transformations,
                you can do so on a cached vertex list and then since each
                polygon uses overlapping vertices to make them all fit tight
                together, you are not doing excessive calculations.
                NOTE: THE REFERENCE STARTS AT VERTEX 0
                The color flag is up to you to change.  The program outputs
                all of them as 0.  You could use this for single color filled
                polygons, or maybe as a texture map referencer.

                Example:

                 4,                     * We have 4 vertices
                 2, 4, 5,               * Here is the first one, x, y, and z
                 2,-4, 5,               * Here is the second one, x, y, and z
                -2, 4, 5,               * Here is the third one, x, y, and z
                -2,-4, 5,               * Here is the fourth one, x, y, and z
                 1,
                 4, 0, 1, 2, 3, 0,      * 4 sides, connecting in order vertex
                                          0 (2, 4, 5)
                                          1 (2,-4, 5)
                                          2 (-2, 4, 5)
                                          3 (-2,-4, 5)
                                          0 is the optional color field

                IF YOU HAVE A COMMONLY USED FORMAT YOU WOULD LIKE TO HAVE
                FUTURE VERSIONS OR SIMILAR PROGRAMS THE ABILITY TO OUTPUT TO,
                E-MAIL ME, I WOULD BE ALL TO HAPPY TO ACCOMODATE YOU.

   That about wraps it up!  I have several ideas for future versions depending
on the feedback I get.  For example: Microsoft's Space Simulator splits the
northern and southern hemispheres into two seperate files.  While I do not
understand the advantages of that as of yet, it would not be difficult to make
this program do the same.

                Jason Reskin

                reskin@pol.net          (preferred)
                jhr4497@cmsu2.cmsu.edu  (alternative)
