Article View: rec.games.programmer
Article #1765Re: Algorithm for Bitmap rotation & scaling
From: Juri Munkki
Date: Sun, 20 Dec 1992 10:28
Date: Sun, 20 Dec 1992 10:28
31 lines
2038 bytes
2038 bytes
Normally for 3D transformations, it is convenient to use a 3x3 matrix with some constant items at the left: | a b 0 | | c d 0 | | e f 1 | Assuming that your vectors are of the form [x y 1], you can then perform translations as well as rotations and the operations can easily be combined. PostScript does all it's scaling and transforming operations using 2x3 matrices that are filled to the above form. Doing just rotations and scales doesn't make much sense, since you can save a lot of multiplies by just adding up the rotation angles and multiplying the scaling operators instead of using matrices. I'm not aware of any personal computer games that would use matrix transforms on bitmaps. I seriously doubt that Wing Commander is using anything like this. From what I have heard (I have only seen the game once or twice), all the shapes are stored as pixel maps. Once you move into polygon or vector based graphics, matrix operations become more plausible. As you noted, the nice thing is that you can scale and rotate (and translate) as much as you want. If you have seen the arcade game "Assault", then you know what kind of effects are possible (although Assault has some hardware assistance and probably uses a DDA to scale and rotate the pixel maps). -- Juri Munkki Windsurf: fast sailing jmunkki@hut.fi Macintosh: fast software
Technical Details
Message-ID:
<1992Dec20.102827.13571@nntp.hut.fi>Path:
arc1-ca.pugleaf.net!sparky!uunet!usc!sdd.hp.com!think.com!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!news.funet.fi!ajk.tele.fi!funic!nntp.hut.fi!vipunen.hut.fi!jmunkkiReferences:
<krisr.724726801@cue>Show Full Headers
Complete Article Headers
Newsgroups: rec.games.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sdd.hp.com!think.com!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!news.funet.fi!ajk.tele.fi!funic!nntp.hut.fi!vipunen.hut.fi!jmunkki From: jmunkki@vipunen.hut.fi (Juri Munkki) Subject: Re: Algorithm for Bitmap rotation & scaling Message-ID: <1992Dec20.102827.13571@nntp.hut.fi> Sender: usenet@nntp.hut.fi (Usenet pseudouser id) Nntp-Posting-Host: vipunen.hut.fi Reply-To: jmunkki@vipunen.hut.fi (Juri Munkki) Organization: Helsinki University of Technology References: <krisr.724726801@cue> Date: Sun, 20 Dec 1992 10:28:27 GMT Lines: 31