Re: LZ: Rotation...


[Prev][Next][Index][Thread]

Re: LZ: Rotation...




On Sun, 15 Jun 1997, Buddy Smith wrote:
> 
> 
> Does anyone know how to rotate a sprite on the screen (w/out USGARD, 
>in case you are wondering...)  I need to turn a simple 15x15 sprite 
>around sideways.  I'm not really quite sure how to do sin/cos 
>rotations (I have no idea how sin/cos even can do rotations) but if 
>someone can help it will be greatly appreciated
> 
> Buddy Smith
> ti85calc@bellsouth.net

I'm not sure how to do it in Z80 asm, but basic rotation is like this:

  newx = x*cos(angle) - y*sin(angle)
  newy = y*cos(angle) + x*sin(angle)

Keep in mind that this rotates counter-clockwise around the origin, so
you would probably want to make the origin be in the middle of the
sprite.

Jonathan Anderson
sarlok@juno.com


References: