Path: chuka.playstation.co.uk!news From: "Scott Ward" Newsgroups: scee.yaroze.programming.2d_graphics Subject: Negative gradients... Date: Fri, 24 Sep 1999 15:33:30 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 23 Message-ID: <7sgeqc$6vn1@chuka.playstation.co.uk> NNTP-Posting-Host: m219-mp1-cvx1a.hud.ntl.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 I've just set up a collision routine made up of standard bounding lines and stuff with look-up tables for co_ord's, gradients, etc. Surprisingly, for me, I got it working to a reasonable degree of accuracy without too many hitches but one thing really has me puzzled. Whenever my algorithm tests for collision between any diagonal line (sprite) and a line with negative gradient one '-1' (scenery) the accuracy is a few pixels out. More so the further up ('up' on screen) the line the collision happens. I've been using fixed point maths for the gradient calculations so all the other lines work out fine accuracy-wise and there's no problem with lines of gradient '+1'. As far as I can tell all other lines with a negative gradient work okay, it only happens when it's '-1' which mathetically shouldn't decrease the accuracy at all 'cos it's all integer calculations. This one's really got me stumped, any help would be much appreciated. Cheers, Scott P.S. I've checked all the look-up tables and all the data's right.