home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / graphics / 13430 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  2.1 KB

  1. Path: sparky!uunet!europa.asd.contel.com!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!swrinde!emory!ogicse!pdxgate!rigel!idr
  2. From: idr@rigel.cs.pdx.edu (Ian D Romanick)
  3. Newsgroups: comp.graphics
  4. Subject: Re: fast bitmap rotation
  5. Message-ID: <6655@pdxgate.UUCP>
  6. Date: 6 Jan 93 02:50:31 GMT
  7. Article-I.D.: pdxgate.6655
  8. References: <726100620.1@freudsys.iaf> <1993Jan4.215419.7730@a.cs.okstate.edu>
  9. Sender: news@pdxgate.UUCP
  10. Organization: /etc/organization
  11. Lines: 29
  12.  
  13. If you are rotating every single point on a machine that doesn't do matrix
  14. math in hardware, then you should be shot!  There are two easy ways to do this
  15. that are at least 100 times faster!
  16.  
  17. 1. This is the easiest, but least versitile method.  You basically shear your
  18.    bit map twice.  Once horizontally and once vertically.
  19.  
  20. 2. This method allows 3d rotation, and scaling.  You create the 'bounding box'
  21.    of your image.  Then you rotate and scale it to your desire.  Now, for each
  22.    scan line you look at where this new polygon crosses.  Each of these two
  23.    points will correspond to a position on the edge of your bit map.  If you
  24.    draw an imaginary line connecting those two points (on the bit map) you will
  25.    draw through the pixels that belong on the current scan line.  From there it
  26.    is just a matter of copying pixels.  This method was covered by Michael
  27.    Abrash in the Sept. `92 issue of Dr Dobbs.  The source to that issue can
  28.    be found on wuarchive.wustl.edu in the mirrors/msdos/ddjmag dir.
  29.  
  30. Hope this helps.  Enjoy!
  31.  
  32.                                   - Ian Romanick
  33.                                     Dancing Fool of Epsilon
  34.  
  35. []--------------------------------------------------------------------[]
  36.  |                                                                    |
  37.  | My opinions are exactly the same as PSU's.  NOT!                   |
  38.  | Mail at:  idr@cs.pdx.edu             Epsilon, for the best in NTSC |
  39.  |                                      demos! :^)                    |
  40.  |                                                                    |
  41. []--------------------------------------------------------------------[]
  42.