delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/20/09:00:49

From: Cherniavsky Beni <cben AT crosswinds DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: rotating bitmaps (or sprites)
Date: Tue, 20 Jun 2000 15:57:31 +0200
Organization: Technion
Lines: 34
Message-ID: <394F784B.9F42DBE5@crosswinds.net>
References: <394D0886 DOT 5CEA4762 AT ne DOT infi DOT net>
NNTP-Posting-Host: 132.68.54.8
Mime-Version: 1.0
X-Mailer: Mozilla 4.06 [en] (WinNT; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

If you use Allegro it has special fuctions for drawing sprites
with rotations, flips, and maybe scaling.  I don't remember exaclty
but the chapter on sprites (regular, maybe RLE, not the compiled ones)
in the Allegro docs has all the info you need.  They allow arbitray
rotations.
If you don't use Allegro and the gfx library you use has no functions
for this you might still want to look at Allegro's sources for that,
but I doubt it will have a readable algorithm - it's surely as optimized
as possible.
BTW, if you only need n*45 degrees rotations, the algoritms get simpler.

Martell wrote:
> 
> i know this isnt a graphics programming group, but im hoping somebody
> might be able to help me out.
> 
> i want to be able to draw a bitmap (or sprite) rotated, because i dont
> want
> to have to have 8 pictures of my sprite in 8 drawn in 8 different
> directions, i just
> want to draw one, and have my program rotate it.  any ideas?
> 
> the only way i can think of how to do this is treat it like a textured
> polygon
> because i cant find source to do it any other way.
> 
> -jeremiah;


-- 
Beni Cherniavsky <cben AT crosswinds DOT net>
                 (also scben AT t2 in technion)
What's the exterior of a domain?
When one takes a bath we shout "Man overboard!".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019