home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / assembler / thesource / volume4 / source / vectors / bmaps.lha / 3dbmaps.txt next >
Encoding:
Text File  |  1993-02-17  |  25.4 KB  |  591 lines

  1.  
  2. Hi, Here is what I have recieved so far some techniques used to do
  3. the graphics in Wolfenstien 3D. I post this to the net. hope it is
  4. useful to you. If you come across anything, please let me know. I
  5. will post another summary if I have more satisfactory answers.
  6.  
  7. ..... Tom
  8.  
  9. ------------------------------------------------------------------
  10.  
  11. Article: 6901 of rec.games.programmer
  12. Newsgroups: rec.games.programmer
  13. Path: dg-rtp!psinntp!rpi!usc!cs.utexas.edu!utgpu!watserv1!dstamp
  14. From: dstamp@watserv1.waterloo.edu (Dave Stampe-Psy+Eng)
  15. Subject: Re: Wolfstein 3D graphics : HOW ??
  16. Message-ID: <1992May14.140542.3654@watserv1.waterloo.edu>
  17. Organization: University of Waterloo
  18. References: <783@hobby.ukc.ac.uk>
  19. Date: Thu, 14 May 1992 14:05:42 GMT
  20. Lines: 44
  21.  
  22. In article <783@hobby.ukc.ac.uk> jm6@ukc.ac.uk (J.Mitchell) writes:
  23. >
  24. >How do the graphics in Wolfstein 3D work, I think they must be bitmapped
  25. >using a lookup table to dump them to the screen. I think this because of the
  26. >speed and the false perspective on the objects such as the suits of armour
  27. >the washbasin etc. ie. if you move around them they don't change shape like
  28. >the walls do. This brings me to the problem of storing all the walls, 
  29. I haven't
  30. >tried to work out the required storeage but it must be very large and 
  31. obviously
  32. >you can get it all into memory but how?
  33.  
  34. A little thought reveals what is done.  First, the program runs in an
  35. X mode varient (hence no flicker).  Therefore it has to access pixels in
  36. columns differing by 4 and do 4 passes (no 4-pixel copies here).  Also,
  37. the perspective of the walls is centered therefore the top-to-bottom
  38. compression/expansion is constant for any column, and the left-to-right
  39. compression may be looked up in a table or calculated on the fly.
  40.  
  41. So what you have are:
  42. -bitmaps in memory of objects and walls
  43. -lookup tables for vertical compression (100 or so at 400 bytes each)
  44. -lookup tables for horizontal compression (optional)
  45.  
  46. You simply select a column in the screen area, lookup the offset
  47. address in the horizontal table, then move down the screen column
  48. adding the horizontal offset, center left screen address, and
  49. the vertical offset from the table to get the address in the bitmap to
  50. read.  This is just an outline, but it's eminantly codeable in assembler
  51. and would get about 1 million pixels/sec on a 386 (500,000 for a slow
  52. 286) with a fast video card (1/2 that for a slow card).
  53.  
  54. Problem is, this method limits the perspective views possible.  It isn't
  55. general enough to use in a 3D generic renderer, for example.  For that,
  56. you need a stepping parametric surface method, which probably is 1/3
  57. or less of the speed.
  58.  
  59.  
  60.  
  61. --------------------------------------------------------------------------
  62. | My life is Hardware,                    |                              |
  63. | my destiny is Software,                 |         Dave Stampe          |
  64. | my CPU is Wetware...                    |                              |
  65. | Anybody got a SDB I can borrow?         | dstamp@watserv1.uwaterloo.ca |
  66. __________________________________________________________________________
  67.  
  68.  
  69.  
  70. Article: 6921 of rec.games.programmer
  71. Newsgroups: rec.games.programmer
  72. Path: dg-rtp!psinntp!uunet!sun-barr!cs.utexas.edu!utgpu!watserv1!dstamp
  73. From: dstamp@watserv1.waterloo.edu (Dave Stampe-Psy+Eng)
  74. Subject: Re: Wolfstein 3D graphics : HOW ??
  75. Message-ID: <1992May17.134700.4605@watserv1.waterloo.edu>
  76. Organization: University of Waterloo
  77. References: <1992May17.063824.15590@zooid.guild.org>
  78. Date: Sun, 17 May 1992 13:47:00 GMT
  79. Lines: 27
  80.  
  81. ross@zooid.UUCP (Ross Ridge) writes:
  82. >dstamp@watserv1.waterloo.edu (Dave Stampe-Psy+Eng) writes:
  83. >>This is just an outline, but it's eminantly codeable in assembler
  84. >>and would get about 1 million pixels/sec on a 386 (500,000 for a slow
  85. >>286) with a fast video card (1/2 that for a slow card).
  86. >
  87. >This I seriously doubt, as you can only get about 1.5Mb/s with a
  88. >REP MOVSW and a fast VGA card (ie. ATI Wonder XL).
  89. >
  90.  
  91. Oh yeah?  With a 280x150 window (42000 pixels) and quick math, you get
  92. about 2uS per loop INCLUDING the VGA access wait time (and of course
  93. you code this inline too).  So that's 84 mS per screen, and the screen clear
  94. and drawing of celing and floor takes 15 mS or less, as it's done in
  95. a special mode.  So that's 10 fps on the slower PCs.  Point is, you
  96. can't expect to do sizing in the X-mode varients and get enhanced
  97. performance.  I know whereof I speak: I've written full-screen 3D
  98. graphics that run at 50 fps with 100 lit polys in 256 color mode.
  99.  
  100.  
  101. --------------------------------------------------------------------------
  102. | My life is Hardware,                    |                              |
  103. | my destiny is Software,                 |         Dave Stampe          |
  104. | my CPU is Wetware...                    |                              |
  105. | Anybody got a SDB I can borrow?         | dstamp@watserv1.uwaterloo.ca |
  106. __________________________________________________________________________
  107.  
  108.  
  109.  
  110. Article: 6922 of rec.games.programmer
  111. Path: 
  112. dg-rtp!psinntp!rutgers!jvnc.net!darwin.sura.net!tulane!uflorida!reef.c 
  113. s.ufl.edu!gmt
  114. From: gmt@reef.cis.ufl.edu (Gary McTaggart)
  115. Newsgroups: rec.games.programmer
  116. Subject: Re: Questions on graphics programming like in Underworld and 
  117. Wolfenstein 3D
  118. Keywords: graphics programming underworld wolfensten
  119. Message-ID: <35574@uflorida.cis.ufl.edu>
  120. Date: 17 May 92 19:17:18 GMT
  121. References: <P.S.Haight.4.0@cornell.edu>
  122. Sender: news@uflorida.cis.ufl.edu
  123. Organization: Univ. of Florida CIS Dept.
  124. Lines: 64
  125. Nntp-Posting-Host: reef.cis.ufl.edu
  126.  
  127. In article <P.S.Haight.4.0@cornell.edu> P.S.Haight@cornell.edu (Peter 
  128. Haight) writes:
  129. >
  130. >   Does anyone have some general idea how they do the graphics for those new
  131. >graphic games like Underworld and Wolfenstein 3D? What I mean is, how do
  132. >they get the real dungeon effect by calculating distances and angles and
  133. >things like that? or what?
  134.  
  135. This is all just speculation, but:
  136.  
  137. Ignoring objects in the scenes, the 3d calculations for the walls are
  138. minimal being that only very few walls can be seen at any given time.  Only
  139. the corners of each wall have to be calculated.  This is simplified by the
  140. fact that the walls are stationary, therefore a lot of pre-processing can
  141. be done for hidden surface removal.  Once the screen coordinates of the
  142. corners of each wall is calculated, it is then just a simple matter of
  143. outputting a scaled version of a "sprite" to the appropriate four-sided
  144. polygonal area on the screen.
  145.  
  146. consider:
  147.        (x1, y1)   |...
  148.                   |   ~~~...
  149.                   |         ~~~...
  150.                   |               ~~~|  (x2, y2)
  151.                   |                  |
  152.                   |                  |
  153.                   |               ...|  (x2, y4)
  154.                   |         ...~~~
  155.                   |   ...~~~
  156.        (x1, y3)   |~~~
  157.  
  158.  
  159.  
  160. Generating the distorted sprite to the screen is simplified by the fact
  161. that the left-most x values for the corners are always equivalent and the
  162. right-most x values are also equivalent.  You can then do a loop which is
  163. indexed by the screen x coordinate from the left to the right.  The sprite
  164. x coordinate is initially zero and is incremented by (sprite_width /
  165. screen_image_width) each iteration.  The inside y loop is similar.
  166.  
  167. I can tell that Wolfenstein uses either ModeX or ModeY, but I'm no sure how
  168. they are using the quirks of either to their advantage.  The most that I
  169. can figure out is that the are doing the outside x loop four times per
  170. image and setting the map mask only once at the beginning of each loop.
  171. Also their is the advantage of multiple pages and all.
  172.  
  173. Of course, this is all pure speculation, but I am in the process of
  174. assembly-izing the above at the moment.  If you are interested in an
  175. extremely ugly C version of the algorithm (for algorithmical purposes only:
  176. it is extremely inefficient), send me some mail.  As soon as I get the
  177. assembly version working, I'll post it so that many hands can improve upon
  178. it.  It includes the ability to load the images from GIF files so that the
  179. plates can be created with any paint program.  I also have an incomplete
  180. library of stuff to manipulate 3d polygonal objects which could be
  181. incorporated, but I'm not sure if I'm going to release that any time soon,
  182. thoug.  I think that they would make a good marriage.
  183.  
  184. By the way, I haven't seen the Ultima game that uses this technique, how is
  185. it?
  186.  
  187. Any input would be appreciated,
  188.  
  189. Thanks,
  190. Gary McTaggart
  191. gmt@cis.ufl.edu
  192.  
  193.  
  194. Article: 6928 of rec.games.programmer
  195. Newsgroups: rec.games.programmer
  196. Path: 
  197. dg-rtp!psinntp!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!jvnc.net! 
  198. arwin.sura.net!mips!mips!munnari.oz.au!uniwa!oreillym
  199. From: oreillym@tartarus.uwa.edu.au (Michael O'Reilly)
  200. Subject: Re: Wolfstein 3D graphics : HOW ??
  201. Message-ID: <1992May18.083607.9732@uniwa.uwa.edu.au>
  202. Sender: news@uniwa.uwa.edu.au (USENET News System)
  203. Nntp-Posting-Host: tartarus.uwa.edu.au
  204. Organization: University of Western Australia
  205. References: <1992May17.063824.15590@zooid.guild.org>
  206. Date: Mon, 18 May 1992 08:36:07 GMT
  207. Lines: 18
  208.  
  209. ross@zooid.guild.org (Ross Ridge) writes:
  210. : dstamp@watserv1.waterloo.edu (Dave Stampe-Psy+Eng) writes:
  211. : >This is just an outline, but it's eminantly codeable in assembler
  212. : >and would get about 1 million pixels/sec on a 386 (500,000 for a slow
  213. : >286) with a fast video card (1/2 that for a slow card).
  214. :
  215. : This I seriously doubt, as you can only get about 1.5Mb/s with a
  216. : REP MOVSW and a fast VGA card (ie. ATI Wonder XL).
  217. Thats about right. 1.5 Mb/s == about 6 million pix's per second.
  218. You are setting 4 pixels with each byte if I remember right???
  219.  
  220. :                             Ross Ridge
  221. :
  222. : --
  223. : Ross Ridge - The Great HTMU                         l/     //
  224. :                                     [OO][oo]
  225. : ross@zooid.guild.org                            /()\/()/
  226. : uunet.ca!torag!zooid!ross                         db     //
  227.  
  228.  
  229. Article: 6931 of rec.games.programmer
  230. Newsgroups: rec.games.programmer
  231. Path: dg-rtp!psinntp!uunet!cs.utexas.edu!utgpu!watserv1!dstamp
  232. From: dstamp@watserv1.waterloo.edu (Dave Stampe-Psy+Eng)
  233. Subject: Re: Wolfstein 3D graphics : HOW ??
  234. Message-ID: <1992May18.134856.1137@watserv1.waterloo.edu>
  235. Organization: University of Waterloo
  236. References: <1992May18.083607.9732@uniwa.uwa.edu.au>
  237. Date: Mon, 18 May 1992 13:48:56 GMT
  238. Lines: 38
  239.  
  240.  oreillym@tartarus.uwa.edu.au (Michael O'Reilly) writes:
  241. >ross@zooid.guild.org (Ross Ridge) writes:
  242. >: dstamp@watserv1.waterloo.edu (Dave Stampe-Psy+Eng) writes:
  243. >: >This is just an outline, but it's eminantly codeable in assembler
  244. >: >and would get about 1 million pixels/sec on a 386 (500,000 for a slow
  245. >: >286) with a fast video card (1/2 that for a slow card).
  246. >:
  247. >: This I seriously doubt, as you can only get about 1.5Mb/s with a
  248. >: REP MOVSW and a fast VGA card (ie. ATI Wonder XL).
  249.  
  250. >Thats about right. 1.5 Mb/s == about 6 million pix's per second.
  251. >You are setting 4 pixels with each byte if I remember right???
  252. >
  253.  
  254.  
  255. Yes, when your'e doing fills where you know the color of all 4 pixels
  256. or they're all the same color.  You load the 4 on-chip plane latches,
  257. then use them in mode X to squirt 4 pixels to the screen with each write.
  258. You can also do fast copies (sprites) from video memory this way.  You waste
  259. 1.5 uS in accessing the mask resister, though, every time you need to access
  260. less than 4 pixels.
  261.  
  262. This method won't work when doing dynamic resizing, and especially not for
  263. 3D texture mapping-- you have to go back to 1 pixel per write.  You can
  264. access every 4th pixels without changing the plane mask register, which is
  265. expensive.  The mapping method I described earlier is column-based, so you
  266. can do every 4th column, change the mask, do the secind set, and so on.
  267. Quite efficient.  1/4 the speed of the 4-pixel fills, but then most of the
  268. screen isn't texture mapped.
  269.  
  270.  
  271. --------------------------------------------------------------------------
  272. | My life is Hardware,                    |                              |
  273. | my destiny is Software,                 |         Dave Stampe          |
  274. | my CPU is Wetware...                    |                              |
  275. | Anybody got a SDB I can borrow?         | dstamp@watserv1.uwaterloo.ca |
  276. __________________________________________________________________________
  277.  
  278.  
  279.  
  280. Article: 6930 of rec.games.programmer
  281. Xref: dg-rtp rec.games.misc:34493 rec.games.programmer:6930
  282. Path: 
  283. dg-rtp!psinntp!rutgers!usc!zaphod.mps.ohio-state.edu!uakari.primate.wi 
  284. c.edu!umriscc!mcs213k.cs.umr.edu!bkirby
  285. From: bkirby@cs.umr.edu (Bill Kirby)
  286. Newsgroups: rec.games.misc,bit.listserv.games-l,rec.games.programmer
  287. Subject: WolfEdit v1.0 (Graphic Editor for Wolfenstein 3-D)
  288. Message-ID: <5118@umriscc.isc.umr.edu>
  289. Date: 18 May 92 10:34:39 GMT
  290. Sender: news@umriscc.isc.umr.edu
  291. Followup-To: rec.games.misc
  292. Organization: University of Missouri - Rolla
  293. Lines: 38
  294. Originator: bkirby@mcs213k.cs.umr.edu
  295.  
  296.  
  297. Our news feed has been down since I posted last, so I don't know what
  298. kind of response I got.  I did get several e-mail requests to upload
  299. my editor, so here it is.
  300.  
  301. I uploaded it to two sites:
  302.  
  303.     wuarchive.wustl.edu (128.252.135.4)
  304.     /pub/MSDOS_UPLOADS/wolfed10.zip
  305.  
  306.     cs.umr.edu (131.151.6.11)
  307.     /bkirby/wolfed10.zip
  308.  
  309. I'm going to remove it from my local site after a week.
  310.  
  311. I decided that my editor was pretty cheezy, so I added a GIF-import
  312. feature that lets you convert a GIF file into a wall image.  Use
  313. your favorite paint/draw program and save it as a GIF.  I just wrote
  314. the GIF decoder yesterday, and it's the first time I've ever written
  315. any LZW compression routines, so it probably still has a bug or two
  316. in it.
  317.  
  318. I didn't include source code, primarily because the code is *REALLY*
  319. ugly.  If I ever clean up the code, i'll include it in future versions.
  320. If you want to know the various file formats, look in FILEINFO.TXT.
  321.  
  322. If you come up with any nifty graphics, upload them for everyone to
  323. see.  I wouldn't upload the VSWAP.WL1 file, because it's huge and it
  324. may violate the "do not distribute any modified version" shareware rule.
  325. Upload the .WAL files instead.
  326.  
  327. Enjoy,
  328.  
  329. +--------------------------+-----------------------------------------------+
  330. |       Bill Kirby         |  Internet:  bkirby@cs.umr.edu                 |
  331. |  Computer Science Dept.  |    Bitnet:  bkirby%cs.umr.edu@umrvmb.bitnet   |
  332. | University of MO - Rolla |      UUCP:  ...!uunet!cs.umr.edu!bkirby       |
  333. +--------------------------+-----------------------------------------------+
  334.  
  335.  
  336. Article: 6938 of rec.games.programmer
  337. Path: dg-rtp!psinntp!uunet!caen!uflorida!reef.cis.ufl.edu!gmt
  338. From: gmt@reef.cis.ufl.edu (Gary McTaggart)
  339. Newsgroups: rec.games.programmer
  340. Subject: Here's some C code for Wolfenstein-type graphics
  341. Message-ID: <35595@uflorida.cis.ufl.edu>
  342. Date: 19 May 92 00:57:52 GMT
  343. Sender: news@uflorida.cis.ufl.edu
  344. Organization: Univ. of Florida CIS Dept.
  345. Lines: 96
  346. Nntp-Posting-Host: reef.cis.ufl.edu
  347.  
  348. Here's some ugly, nasty, uncommented, inefficient C code to place sprites
  349. on the screen as necessary for games such as Wolfenstein 3d.  It is
  350. completely unoptimized and I'm not sure if this is even the algorithm that
  351. they are using, but it works.
  352.  
  353. x1:  the leftmost x coordinate for the screen image.
  354. x2:  the rightmost x coordinate for the screen image.
  355. y1:  the y coordinate of the upper-left of the screen image.
  356. y2:  the y coordinate of the upper-right of the screen image.
  357. y3:  the y coordinate of the lower-left of the screen image.
  358. y4:  the y coordinate of the lower-right of the screen image.
  359.  
  360. Notice that the x coodinate for the 2 leftmost corners equivalent, as is in
  361. Wolfenstein.  (Same goes for the right.)
  362.  
  363. The sprite is a understood to be a continuous stream in memory of the
  364. palette indices for the image.
  365.  
  366. In order to use this, you need to calculate the screen coordinates of the
  367. corners of a wall tile.  (All of the walls are made up of square tiles.)
  368. If you don't know how to do this, I will soon post stuff to do this with,
  369. or consult Foley and Van Damn (Computer Graphics: Principles and
  370. Practices).  I will also be posting some code to read GIF files for use
  371. with this.  The tiles can not be too large because the distortion of the
  372. images is only an approximation for where each actual "pixel" would be.
  373. Forshortening is only taken account for on the level of the tiles
  374. themselves and their corners.
  375.  
  376. The code assumes mode 13h (320x200x8bit) for simplicity.  Keep in mind that
  377. the code is not *NEAR* to completion and is only here to show the algorithm
  378. involved.  The following improvements must be made before it is even close
  379. to being usable:
  380.  
  381.   1. The "quirks" of ModeX must be taken into account as advantages.
  382.      eg. If you limit the number of colors for a given tile, you can
  383.          preload all possible combinations of the color into an unviewed
  384.          video page and spit out 4 pixels at one time.  Also, if you choose
  385.          not to do the preloading in preference of more colors, then you
  386.          can write every fourth column in four passes, loading the map mask
  387.          only once for each column.
  388.  
  389.   2. 386 specific code would probably be benificial considering that most
  390.      of the values used are 16.16 fixed point.  We could take advantage of the
  391.      32 bit math instructions.
  392.  
  393.   3. It needs to be ported to assembler.  I am currently working on doing
  394.      this, but I be RRRREEEEAAAALLLL slow with writing assembly!!!!!!!
  395.  
  396. Any ideas would be greatly appreciated.  I am not sure if all of this crap
  397. covers everything that needs to be known in order to make this run efficiently.
  398.  
  399. Any questions, comments, flames, etc would be greatly appreciated,
  400.  
  401. Thanks,
  402. Gary McTaggart
  403. gmt@cis.ufl.edu
  404.  
  405.  
  406. ------------------------------------------------------------------------------
  407.  
  408. extern unsigned char far *vid;
  409.  
  410.  
  411. void out( const char *sprite, int sprite_width, int sprite_height,
  412.            int x1, int x2, int y1, int y2, int y3, int y4)
  413.   {
  414.     long topslope, botslope, yimage_top, yimage_bot, x_ratio, y_ratio,
  415.          xsprite, ysprite;
  416.     int  ximage, yimage, yimage_bot_shr_16;
  417.     unsigned int vidoffset;
  418.  
  419.     topslope = ( ( long )( y2 - y1 ) << 16 ) / ( x2 - x1 );
  420.     botslope = ( ( long )( y4 - y3 ) << 16 ) / ( x2 - x1 );
  421.     yimage_top = ( long ) y1 << 16;
  422.     yimage_bot = ( long ) y3 << 16;
  423.     x_ratio    = ( ( long ) sprite_width << 16 ) / ( x2 - x1 );
  424.     ximage = x1;
  425.     xsprite = 0;
  426.     for( ; ximage < x2; ximage++, xsprite += x_ratio )
  427.       {
  428.         y_ratio = ( ( long ) sprite_height << 16 ) / ( ( yimage_bot  -
  429.                     yimage_top ) >> 16);
  430.         ysprite = 0;
  431.         yimage = yimage_top >> 16;
  432.         vidoffset = 320 * yimage + ximage;
  433.         yimage_bot_shr_16 = yimage_bot >> 16;
  434.         for( ; yimage < yimage_bot_shr_16; yimage++, ysprite += y_ratio )
  435.           {
  436.             *( vid + vidoffset ) = sprite[( xsprite >> 16 ) +
  437.                                    ( sprite_width * ( ysprite >> 16 ) )];
  438.             vidoffset += 320;
  439.           }
  440.         yimage_top += topslope;
  441.         yimage_bot += botslope;
  442.       }
  443.   }
  444.  
  445.  
  446. Article: 6947 of rec.games.programmer
  447. Newsgroups: rec.games.programmer
  448. Path: dg-rtp!psinntp!rpi!usc!cs.utexas.edu!utgpu!watserv1!dstamp
  449. From: dstamp@watserv1.waterloo.edu (Dave Stampe-Psy+Eng)
  450. Subject: Re: Wolfstein 3D graphics : HOW ??
  451. Message-ID: <1992May19.221820.25442@watserv1.waterloo.edu>
  452. Organization: University of Waterloo
  453. References: watserv1.waterloo.edu> <1992May19.040211.4109@zooid.guild.org>
  454. Date: Tue, 19 May 1992 22:18:20 GMT
  455. Lines: 44
  456.  
  457.  ross@zooid.guild.org (Ross Ridge) writes:
  458. >
  459. >42000 pixels in 84 ms is only 500,000 pixel/sec not the 1 million
  460. >you claim.  I wouldn't mind seeing this quick math.
  461. >
  462.  
  463. Since not all machines are as fast as mine, I used the slower end of the
  464. range.  I try to be cautious that way.  There are several ways to get that
  465. speed, even writing one pixel at a time.  The idea is to eliminate the
  466. needs for any more calculations than a table lookup, or an add and shift.
  467. This is easily done for the special perspective case of the W grphics.
  468.  
  469. For full 3D texture mapping (as in the Underworld demo) you cannot use
  470. table lookups, but there are iterative algorithms using adds and shifts
  471. for this as well.  Speeds here are 2 or 3 times as slow.
  472.  
  473. For the W graphics, you precompute a table (one entry for each column of
  474. the poly on-screen) containing the bitmap start address, screen start address,
  475. compression factor (8 bits integer, 8 bits fractional) and the number of
  476. pixels in the screen column.  This can be done with little math.
  477. Then for each screen column, you load registers from the table then
  478. loop.  For best results, use an inline implementation and use a jump vector
  479. to the start or end.
  480.  
  481. add    dl, ah
  482. adc    bx,si
  483. mov    al,es:[bx]
  484. mov    al,0000[di]    ; one number for each screen offset so no inc needed
  485.  
  486. dl is the fractional step accumulator, si is the integer step, bx is the
  487. bitmap pointer, di is the screen column pointer, al holds the fractional step.
  488. Repeat as needed in memory (200x max) then offset the column address and
  489. jump to the correct entry point to set the number of pixels in the column.
  490. Load dl, si, bx, and di from the column start table.  THis code will execute
  491. at 1 Mpix/sec on a 386/25 or better and a fast VGA card.
  492.  
  493.  
  494. --------------------------------------------------------------------------
  495. | My life is Hardware,                    |                              |
  496. | my destiny is Software,                 |         Dave Stampe          |
  497. | my CPU is Wetware...                    |                              |
  498. | Anybody got a SDB I can borrow?         | dstamp@watserv1.uwaterloo.ca |
  499. __________________________________________________________________________
  500.  
  501.  
  502.  
  503. Article 9400 of rec.games.programmer:
  504. Xref: netcom.com comp.graphics:30649 alt.graphics:945 alt.msdos.programmer:6316 comp.programming:3657 rec.games.programmer:9400
  505. Newsgroups: comp.graphics,alt.graphics,alt.msdos.programmer,comp.programming,rec.games.programmer
  506. Path: netcom.com!csus.edu!wupost!howland.reston.ans.net!spool.mu.edu!agate!ames!saimiri.primate.wisc.edu!sdd.hp.com!ux1.cso.uiuc.edu!news.cso.uiuc.edu!ph-meter.beckman.uiuc.edu!trimble
  507. From: trimble@ph-meter.beckman.uiuc.edu (Chris Trimble)
  508. Subject: Re: Help with Grapics Techniques
  509. References: <1993Feb2.192545.18255@ultb.isc.rit.edu>
  510. Message-ID: <trimble.728696279@ph-meter.beckman.uiuc.edu>
  511. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  512. Organization: University of Illinois at Urbana
  513. Date: Tue, 2 Feb 1993 23:37:59 GMT
  514. Lines: 26
  515.  
  516.  
  517. In comp.graphics you write:
  518.  
  519. >I am looking for references, either books or source code, to the technique
  520. > used  to do the graphics in Wolfenstien 3D.  I am familar with 3D
  521. >graphics and texture mapping, but I am unsure of the best way to apply this to
  522. >a 3D maze.
  523.  
  524.  From what I have come to understand, all of the so-called "3D" in C.W. was
  525.  pre-drawn and then just scaled to the screen. Think of it this way --- for
  526.  each little 3-d effect on the screen, the writers have drawn a corresponding
  527.  bitmap.. then the program just scales to according to its depth (i.e. -
  528.  shrinks it if its far away, makes it grow if its near).
  529.  
  530.  If you think about it, this is what the arcade game manufacturers do, too.
  531.  Very few arcade games have rendered-on-the-fly 3-d, and you can tell 
  532.  straight off that that's what they are doing. Atari is the only one that
  533.  comes to mind right now (e.g. Hard Drivin'). A good example of an arcade
  534.  game that uses this 'phoney' three-d is AfterBurner II. In fact, I think
  535.  most of the Sega games do this.
  536.  
  537.    - Chris
  538.  
  539. --
  540. Chris Trimble                Fight the real enemy! <Tears up picture of Elvis> 
  541. Beckman Institute Systems Services  -  chris1@uiuc.edu  -  PGP key available. 
  542.  
  543.  
  544. Article 9472 of rec.games.programmer:
  545. Xref: netcom.com comp.graphics:30783 alt.graphics:954 alt.msdos.programmer:6350 comp.programming:3713 rec.games.programmer:9472
  546. Path: netcom.com!netcomsv!butch!kronos.arc.nasa.gov!ames!haven.umd.edu!darwin.sura.net!spool.mu.edu!uwm.edu!ogicse!flop.ENGR.ORST.EDU!gaia.ucs.orst.edu!umn.edu!csus.edu!sfsuvax1.sfsu.edu!kschang
  547. From: kschang@sfsuvax1.sfsu.edu (Kuo-Sheng Chang)
  548. Newsgroups: comp.graphics,alt.graphics,alt.msdos.programmer,comp.programming,rec.games.programmer
  549. Subject: Re: Help with Grapics Techniques
  550. Message-ID: <1993Feb5.210700.5489@csus.edu>
  551. Date: 5 Feb 93 21:07:00 GMT
  552. Article-I.D.: csus.1993Feb5.210700.5489
  553. References: <trimble.728696279@ph-meter.beckman.uiuc.edu> <1993Feb5.023217.24145@scammell.ecos.tne.oz.au>
  554. Sender: news@csus.edu
  555. Organization: San Francisco State University
  556. Lines: 31
  557.  
  558. In article <1993Feb5.023217.24145@scammell.ecos.tne.oz.au> pcm@scammell.ecos.tne.oz.au (Peter Murray) writes:
  559. >
  560. >What about Comanche?  Apparantly this game is generating terrain
  561. >in real time based on terrain maps, although the various
  562. >helicopters and tanks seem to be of the pre-drawn bitmap
  563. >type (as in Wing Commander).
  564. >
  565. >I have seen the question brought up a number of times in this group
  566. >regarding the techniques used in Wolfenstein and Commanche but
  567. >have never seen a satisfactory answer, e.g. what optimisation
  568. >techniques are they using to get the speed and what (assembler)
  569. >tricks they are using.
  570.  
  571. I don't have any sources, but I managed to get into the Wolf3D's debug
  572. mode and found that their walls are ALL predrawn.  It is not inconceivable
  573. that they preloaded the bitmaps for the walls and did 3-D projection of them
  574. on the fly.  After all, as you move around, you can notice the seams in
  575. the tiles that makes up the walls.  Squashing a bitmap is not that hard,
  576. esp when Wolf used oversized pixels.
  577.  
  578. Terrain in Commanche, while looks amazing from flight-view, is actually
  579. not as impressive as we are led to believe.  Upon closer view, the terrain
  580. is actually MORE tiles (though they blend together quite nicely).  
  581. My guess is the program have data for different elevations and used that 
  582. to determine which view of the tile to display.  That's why you need 4 megs:
  583. so it can put together all those teeny pieces of bitmap before it shows you!
  584.  
  585. This is obviously a total guess on my part, and may NOT be accurate.  
  586. Any one from NovaLogic reading this?  :-)
  587.  
  588. --Kasey Chang
  589.  
  590.  
  591.