Path: chuka.playstation.co.uk!news From: Jim Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Rotation property of sprites Date: Tue, 07 Apr 1998 10:56:47 +0100 Organization: Mobius Codeworks Ltd. Lines: 37 Message-ID: <3529F85F.7EFC4AC3@micronetics.com> References: <352a3987.6501481@www.netyaroze-europe.com> NNTP-Posting-Host: 193.132.195.245 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.03 [en] (WinNT; I) Dave, I often roll my rotations back to zero, it can help simplify some of the maths required for shortest path on rotations. Use 4096 as 360deg. An easy way to flip back to zero is to used a bitwise &, take rx as the variable. rx += 32; // rotate it a bit rx &= 4095; // mask out anything > 4095 If you want to measure everything in degreese. rx += 32; rx %= 360; // wrap back to 0 Its possible that the psx doesn't trap an overflow exception and would get stuck in the exception handler. Although I would doubt this as overflowing regs would be quite common. Jim David Wagner wrote: > > Hi, > > When I use the rotation property of a sprite, should I limit it to 360 > degree's (ie 360 * 4096) and then flip it back to 0? > > I ask because when I set a sprites rotation to MAX_LONG and then tried > to rotate it 1 unit more, it seemed to cause the yaroze to crash. > > bye... > Dave