Path: chuka.playstation.co.uk!news From: James Shaughnessy Newsgroups: scee.yaroze.beginners Subject: Re: angles, angles Date: Fri, 20 Nov 1998 04:14:20 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 27 Message-ID: <3654EC9C.7C02@manc.u-net.com> References: <72spa7$dvm12@chuka.playstation.co.uk> <72sr28$dvm13@chuka.playstation.co.uk> <3652971c.228584498@news.playstation.co.uk> <731up3$olq9@chuka.playstation.co.uk> Reply-To: james@manc.u-net.com NNTP-Posting-Host: manc.u-net.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0 (Win95; I) Darren Jackson wrote: > ONE=4096=1degree, right? > should I convert to degrees before using it in sin and cos? I'm an idiot, as soon as I post it I get what you were getting at. You are using the sprite's actual .rotate value as its rotation, so yes 4096 == 1 degree, but this needs to be scaled to whatever lookup tables/trig library you are using. So if you use 360 as your SIN[]/COS[] size (with "scbuild 360") then just divide the .rotate by 4096 (>>12) to get the array index as a degree. Job's a good'en. BE SURE though to limit the range of .rotate between 0~(4096*360-1) when doing this (with mod %), otherwise wierd things will happen (BUG CITY). The best way to avoid this is to NOT use .rotate as your sprite angle variable, ie. store it in a STRUCT, and merely set .rotate after manipulating the other variables. Etc. 4096 = 1 degree is a pain in the arse when other structs use 4096 as 360 degrees. Still, what can you do. Joey Joe joe. -- ----------------------------------------- James Shaughnessy james@manc.u-net.com http://www.netyaroze-europe.com/~shaughnj -----------------------------------------