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