Article View: rec.games.programmer
Article #879Re: Question: Rotating a small bitmapped image?
From: Bryan Miller
Date: Wed, 26 Aug 1992 16:30
Date: Wed, 26 Aug 1992 16:30
19 lines
1423 bytes
1423 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. Rotating the bitmap is easy. Apply a 2x2 rotational transformation of sin/cos the angle you want to rotate by. |> And suggestions on one that would not degrade the image That's the tough part. The rotation is gives you floating point results (between) pixels. When you integerize, it'll get a little blocky. If you're really keen on getting good results you'll have to clean it up (esp. the edges). Convolve the image with a Laplacian mask (3x3 would be (0,1,0),(1,-5,1),(0,1,0)) to smooth it. These are simple to apply, and give reasonable results. Bryan
Technical Details
Message-ID:
<1992Aug26.163036.8896@bnr.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!torn!cunews!nrcnet0!bnrgate!bcars267!bnr.ca!greyReferences:
<1992Aug26.152939.4449@uxa.ecn.bgu.edu>Show Full Headers
Complete Article Headers
Newsgroups: rec.games.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!torn!cunews!nrcnet0!bnrgate!bcars267!bnr.ca!grey From: grey@bnr.ca (Bryan Miller) Subject: Re: Question: Rotating a small bitmapped image? Message-ID: <1992Aug26.163036.8896@bnr.ca> Sender: news@bnr.ca (usenet) Nntp-Posting-Host: bmerh9ad Reply-To: grey@bnr.ca (Bryan Miller) Organization: Bell-Northern Research Ltd. References: <1992Aug26.152939.4449@uxa.ecn.bgu.edu> Date: Wed, 26 Aug 1992 16:30:36 GMT Lines: 19