home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / msdos / asm / 3dvect25 / readme.doc < prev    next >
Encoding:
Text File  |  1993-09-06  |  13.0 KB  |  258 lines

  1.  
  2.                           3d Vectors Source 2.5
  3.  
  4.    Date of release - sept 6/93
  5.  
  6.    Written by: John McCarthy
  7.                1316 Redwood Lane
  8.                Pickering, Ontario.
  9.                Canada, Earth, Milky Way
  10.                L1X 1C5
  11.  
  12.    Home phone, (416) 831-1944, don't call at 2 am eh!
  13.  
  14.    Ok, lets make this quick...
  15.  
  16.    Routines to be used by all for anything, just send me  a  copy  of  what
  17.    you've accomlished (final product) - or at least send me a postcard from
  18.    someplace near where you live.
  19.  
  20.    Many thanks to: Razor - for providing source for their demo.  This  gave
  21.                    me the idea of how to draw polygons in the first place.
  22.  
  23.                    Mode X routines - Matt Pritchard
  24.  
  25.                    Protected Mode Header - Tran
  26.  
  27.                    Bitmap X-mode Scaling routine - John A. Slagel
  28.  
  29.                    Technical support - Robin Ward
  30.                                        Danny Hawrysio
  31.                                        Robert Johnson
  32.                                        Ciaran Gultniers
  33.                                        Mark Rostek
  34.                                        Sebastian Dwornik
  35.                                        Adam Kurzawa
  36.  
  37.                    Food provided by - My Mommy
  38.  
  39.   As noted above, this file would not  be  possible  without  other  people
  40.   giving away their source code.  I continue the tradition of "knowledge is
  41.   power" and give this away.  Most people who see this will never do a damn
  42.   thing with it but look at it and say "uh, so, what next?" so I don't want
  43.   you to register or anything dumb like that.  By the way, people who  want
  44.   money for crappy shareware progs can rot in hell.  But if you do  make  a
  45.   commercial game, and make billions, at least  send  me  a  postcard  from
  46.   the Bahamas ok!  Like I'm not going  to   refuse  a  cheque if  you  make
  47.   something commercial, but like I said, only 1 in a million  may  actually
  48.   have the time/effort/patience/guts/brains to make a commercial game.
  49.  
  50.   The original Mode X routines have been  modified   to  support  protected
  51.   mode.  Many thanks Matt Pritchard for the X-Mode knowledge.  I  hope  you
  52.   don't mind my changing your routines.  Matt Pritchard can be  reached  at
  53.   P.O. Box 140264, Irving, TX  75014  USA.
  54.  
  55.   The protected mode header has been supplied by TRAN and can be reached on
  56.   Sound Barrier BBS (718)979-6629.  I have included all of TRANs  protected
  57.   mode package because I really hate getting code from  someplace  and  not
  58.   getting the support for it.  I make no claim  to  any  of  this  code,  I
  59.   simply want to supply you with all the info to effectively work with this
  60.   3d vector package.
  61.  
  62.   The bitmap scale routine has been supplied by John A. Slagel.  Thanks  to
  63.   you as  well  where  ever  you  are.   The  scale  routine  now  supports
  64.   transparent bitmapping.  As of this writing, John  A.  Slagel's  internet
  65.   access has been canceled and I have no other address for him.
  66.  
  67.   If you want the original non-protected mode Vector  routines, I  can  dig
  68.   them up for you if you send me a  disk  or  something.   But  first,  ask
  69.   yourself, "Why would anyone want to  go back to  segmented  coding?"   If
  70.   you still want those  routines, hit  self  on  head  with  nearest  blunt
  71.   object and re-ask question.  (Many thanks TRAN)
  72.  
  73.   Routines are heavily optimized for 3d  vectors.   Any  code/routine  that
  74.   slow is not intended to be used with animation and has  been  written  to
  75.   simply get the job done.  You will know which routines are slow/fast once
  76.   you look at the code.
  77.  
  78.   I don't apologize for the lack  of  effective  documentation  or  example
  79.   programs as this code was written for my own use.  I would like to  spend
  80.   more time writing code than writing docs.  I also don't apologize for the
  81.   lack of universality of code execution.  For example, Matts xmode code is
  82.   callable from C but mine isn't.  Some of the routines must have registers
  83.   set up before entry and some require memory to be set up.  U figure which
  84.   is which.  It usually says at the begining of the routine.   Once  again,
  85.   making  everything callable from C slows things down  and  this is what I
  86.   wanted to avoid.  Speed is the key considering it is for my own use.
  87.  
  88.   You must have a 386 to run this.  If you only have a 286, get a  job  and
  89.   buy a real machine!
  90.  
  91.   Also, I really hate people who give away their "source" code but actually
  92.   only give away the object file.  If these people are so embarassed  about
  93.   their crappy code then we don't want your crappy object file.  Give  away
  94.   all or nothing.
  95.  
  96.   It would be really nice if I got a postcard from some place near where you
  97.   live.
  98.  
  99.     Some files in this zip:
  100.  
  101.       main.asm      ; example program to show vectors
  102.       3d1.asm       ; 3d vector routines by John McCarthy, fast sort method
  103.       3d2.asm       ; 3d vector routines by John McCarthy, full sort method
  104.       xmode.asm     ; xmode routines by Matt Pritchard
  105.       xmouse.asm    ; xmode/protected mode mouse routines
  106.       pmode.asm     ; protected mode routines by TRAN
  107.       file.asm      ; pmode file routines by TRAN
  108.  
  109.       xmode.inc     ; files defining externals for linkage
  110.       xmouse.inc    ; with above asm files
  111.       pmode.inc
  112.       3d.inc
  113.       file.inc
  114.  
  115.       xscale.inc    ; bitmap scaling routines
  116.       math.inc      ; math functions for 3d.asm
  117.       sin.inc       ; data tables for math functions: math.inc
  118.       arctan.inc    ; inverse tan function tables: math.inc
  119.       vars1/2.inc   ; variables for 3d.asm routine
  120.       equ.inc       ; list of constants
  121.  
  122.       macros.inc    ; macros used throughout
  123.  
  124.       qb.zip        ; qb quickbasic programs to generate sin and arctan tables
  125.       modex104.zip  ; (some of the) original files from Matt's modex104.zip
  126.  
  127.   Some bugs fixed for 2.1:
  128.  
  129.     Mouse routine draw_bitmap fixed (start of bitmap is x and y). Fixes crash
  130.  
  131.     Also, the mouse resolution has been divided by two to stop that dang  two
  132.     pixel movement!
  133.  
  134.     Many bugs fixed in Xmode.asm conversion from segmented mode to protected
  135.     mode.  Too many protected mode bug fixes to list.
  136.  
  137.     Also added some palette fading routines to xmode.asm
  138.  
  139.     The big change is the new method of  sorting  surfaces.   Before,  objects
  140.     were sorted first, then surfaces within objects were sorted.  Now, drawing
  141.     an object simply draws the surfaces in   memory   and  then  ALL  surfaces
  142.     are sorted as a group.  This now allows small objects to go inside  larger
  143.     objects.  This is not possible in 3d1,  small objects will disappear.  The
  144.     3d1 file is faster but the 3d2 file has greater flexability with  objects.
  145.     The old file is 3d1.asm while the full sorting file  is  3d2.asm.  To  use
  146.     you must call sort_list and drawvect after makeobjs (if using  3d2  -  the
  147.     full sort method).  See main1 and main2 for examples.   To  give  you  the
  148.     speed difference between the two, the calculation for a   bubble  sort  is
  149.     (n^2+n)/2 for number of times routine will sort.  In 3d1 - 30 objects with
  150.     30 sides will take 465 sorts * 30 objects + 465 to sort those  objects  is
  151.     =  14,415  loops.   But  3d2  uses  the  basic  30*30  sorts.   Therefore,
  152.     (900^2+900)/2 = 405,450 loops!  You can use 3d2 in portions and still  get
  153.     the speed of 3d1 if you know certain objects will be far or near (eg  land
  154.     scapes and stars are always far) and this can provide you with  the  speed
  155.     and versatility of objects going inside one another.  The only  difference
  156.     between 3d1 and 3d2 is the sort method - full objects then surfaces (3d1),
  157.     or all surfaces together (3d2).
  158.  
  159.     Also made it possible to now have points (single dots) and  bitmaps  as
  160.     part of an object.  You no longer need to make a bitmap it's own object
  161.     but can now have it as part of another object.  It is still possible to
  162.     have bitmaps as their own objects (for explosions and bullets).     See
  163.     sphered cube and regular sphere in example file.
  164.  
  165.   Optimizations for 3dvect22:
  166.  
  167.     Better make1obj routine  now  uses  ematrix  more  efficeintly  by  only
  168.     calculating matrix x,y and z as needed - makes better use  of  cpu  time
  169.     when there are many objects off screen (behind camera or too far lft/rgt
  170.     up/dwn)
  171.  
  172.     Added more math functions
  173.  
  174.     Optimized erotate when usez = no
  175.  
  176.   Changes for 3dvect23:  Aug 10/93
  177.  
  178.     Implemented new pmode.asm code by TRAN.  This replaces the  start32  code
  179.     and allows 3dvect to be run with memory managers like HIMEM  and  EMM386.
  180.     Many thanks to TRAN!  Note: Maximum speed is still found with  no  memory
  181.     managers - ei. raw memory.  Change all int 30h's to int 33h's.
  182.  
  183.     Removed some common routines from 3d1 and 3d2 and put them in poly.inc to
  184.     avoid duplicate copies of routines.
  185.  
  186.     Also added to xmode.asm routines to turn off the screen to stop flicker
  187.     when changing into xmode
  188.  
  189.     Updated TGA2ICON program so it will function with the new pmode header
  190.     and can operate with those nasty memory managers.
  191.  
  192.     I am currently writing this from my living room floor where I  have  been
  193.     laying for the last month due to a herniated disc in my lower back - fun!
  194.  
  195.   Additions for 3dvect24:  Aug 29/93
  196.  
  197.     The main addition for version 2.4 is the IRQ  routine  that  co-ordinates
  198.     itself  with  the  routine  updvectors.   The  IRQ  increments  the  byte
  199.     traces_past every time a vertical retrace occures  (regardless  of   what
  200.     the vector routines are doing) and the routine updvectors (get it, up the
  201.     vectors - d=the, like the poor people say) anyway, updvectors  uses  this
  202.     value to make the objects/animation "jump" ahead and  skip  frames.   the
  203.     slower the computer or the greater number of objects  there  are  on  the
  204.     screen, the higher the value  traces_past  will  be  after  updating  the
  205.     screen.  Therefore, if you write your own game/animation, use this  value
  206.     to determine how fast the game should go - the IRQ is timed to match  the
  207.     vertical retrace so every time one passes by, traces_past gets +1. I have
  208.     two interrupts - a protected mode IRQ and a real mode IRQ. I did it  this
  209.     way so that if you want to add music or whatever, you can use either type
  210.     of IRQ.  Both add 1 to traces_past.  Also, I have timed  the  IRQ  to  be
  211.     close to the vertical retrace time but I don't know if  I  have  done  it
  212.     correctly.  If you notice that the out dx,al is not the way to  go  about
  213.     it, drop me a line with the correct method of  setting  the  8253  timer.
  214.     The value of traces_past will be from 1 to whatever (never 0 after trace)
  215.  
  216.     I also fixed a small bug in the updvectors routine - which is now  called
  217.     updvectors2, called by "updvectors".
  218.  
  219.     I have also had a back operation to fix that herniated disc  and  am  now
  220.     sitting upright at my computer.  So I have this message for you:  Sit  up
  221.     straight at all occasions, bend from the knees, get two  people  to  lift
  222.     a heavy object, don't be macho,stand straight at all times,walk straight,
  223.     don't slouch when driving, don't over excercise, don't prop your head  up
  224.     with your arm when watching TV, (put adjective here) straight.  TAKE CARE
  225.     OF YOUR AMAZING MOTION MACHINE - YOUR BACK.   Learn  the  easy  way  from
  226.     someone who learnt the hard way - we're not invincible. STRAIGHT STRAIGHT
  227.     STRAIGHT! STRAIGHT! STRAIGHT! STRAIGHT! There, I'm done.
  228.  
  229.   Some bugs fixed for 2.5:
  230.  
  231.     Fixed the timer IRQ to have OUT 43h,AL (You'll never know the  difference
  232.     but I thought it would be a nice gesture)
  233.  
  234.     I have also ripped a routine from someplace else  to  time  the  vertical
  235.     retrace and set the irq to this value.  This replaces the static variable
  236.     with a more accurate calculation for each computer's irq timing.
  237.  
  238.     I also added a total retrace counter called "frame_number"  which  counts
  239.     from the begining of any animation so you can, let's say at  2.5  minutes
  240.     into it, perform a certain function.  The  counter  is  only  reset  when
  241.     reset_raster_count is called (begining of new animation sequence).
  242.  
  243.     I have also changed the math routine setsincose so that if  you  are  not
  244.     using z rotations, you won't need to reset eyeaz to 0.  (Can be anything)
  245.     This really doesn't increase speed much though.
  246.  
  247.     I optimized some of the imuls with a pre-calculated table. Just to remind
  248.     you:  Changing  video  modes  can occure within the program, but you  can
  249.     only change the vertical size, not the horizontal size (eg  swap  between
  250.     320x400 mode and 320x200 mode, or 360x480 mode   and  360x240  mode)  You
  251.     would only need to adjust the clipping limits and the make3d constants to
  252.     change modes while the program is  executing.   Re-assembley   would   be
  253.     required if you wanted to change into a different x-width mode.
  254.  
  255.     Fixed the xmouse.asm routine plot_mouse.  It was  not  using  an  earlier
  256.     xmode bitmap change.
  257.  
  258.