Article View: rec.games.programmer
Article #889Re: Question: Rotating a small bitmapped image?
From: Daniele Piponi
Date: Thu, 27 Aug 1992 09:20
Date: Thu, 27 Aug 1992 09:20
18 lines
1524 bytes
1524 bytes
In article <1992Aug26.152939.4449@uxa.ecn.bgu.edu> mucds@uxa.ecn.bgu.edu (Corey D. Stinson) writes: > Could someone help me with a problem. I have a small sprite > (bitmapped) and when animating, instead of re-drawing the picture over > and over to repesent the rotation stages I would like to develop some > algorithm to rotate the image. There's a neat algorithm in Introduction to Computer Graphics by Foley, van Dam et alia for rotating bit maps, or doing any linear operation. If you're happy with matrices then write your rotation matrix as a product of two shears, one preserving x-coordinates and one preserving y-coordinates. Each one is then really easy to implement as it acts only on a row or column at a time and so you only have to do a couple of multiplications for the whole bitmap making it incredibly fast. -- /\___/\ For further details mail --> udah001 @ elm.cc.kcl.ac.uk \/o o\/ \_._/ Dan Piponi dpiponi @ maths1.mth.kcl.ac.uk
Technical Details
Message-ID:
<1992Aug27.092019.14226@ctr.columbia.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!usc!sol.ctr.columbia.edu!newsReferences:
<1992Aug26.152939.4449@uxa.ecn.bgu.edu>Show Full Headers
Complete Article Headers
Newsgroups: rec.games.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sol.ctr.columbia.edu!news From: dpiponi@bach.mth.kcl.ac.uk (Daniele Piponi) Subject: Re: Question: Rotating a small bitmapped image? Organization: Columbia University Center for Telecommunications Research References: <1992Aug26.152939.4449@uxa.ecn.bgu.edu> Message-ID: <1992Aug27.092019.14226@ctr.columbia.edu> Sender: news@ctr.columbia.edu (The Daily Lose) Date: Thu, 27 Aug 1992 09:20:19 GMT X-Posted-From: bach.mth.kcl.ac.uk X-Posted-Through: sol.ctr.columbia.edu Lines: 18