Path: chuka.playstation.co.uk!news From: sceetech Newsgroups: scee.yaroze.programming.libraries Subject: Re: Rotation Matrix Functions Date: Wed, 09 Apr 1997 11:13:45 +0100 Organization: SCEE Lines: 39 Message-ID: <334B6BD9.16E5@interactive.sony.com> References: <01bc4074$bd79ee80$d603e8c3@fred> <3345420f.1403970@news.playstation.co.uk> <3345606A.51F9@innotts.co.uk> <3345a710.544618@news.playstation.co.uk> <01bc4274$05a266a0$0805e8c3@fred> <3349dfe5.3964351@news.playstation.co.uk> <01bc4447$49f08ec0$0b16e8c3@fred> Reply-To: ps_yaroze@interactive.sony.com NNTP-Posting-Host: 194.203.13.10 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01 (Win95; I) Michael Enoch wrote: > > Doh! I thought it was OK but after a while I noticed a small change in the > shape of my object, after further testing it turns out that the function I > was using is also wrong. So I substituted the RotMatrix function calls > with my own matrix functions as Alex suggested, now it works better but > still develops a wobble. It looks like I have jelly on the screen, would be > great for an underwater game........... > > Either the other functions also have faults(Bad News) or I'm doing > something wrong(But I don't see how). > > Any more suggestions would be greatly appreciated. > > Mike. There's nothing intrinsically wrong with any of the Yaroze functions. The problem you're seeing is resultant on iterative updating of the matrix leading to cumulative errors; it happens on lots of systems, whether using fixed or floating point math. The simplest solutions I know of are (a) recompute the matrix from its (stored) original and one rotation angle. Only applicable when matrix only ever gets rotated in one given plane. (b) monitor the matrix and 'repair' it once in a while. The distortion of the TMD on screen is because the basic conditions of proper matrices become broken by iterative compounding of error: the conditions being that the matrix expresses three unit orthogonal vectors. Inspect the matrix every N frames, restore it to that state (take the current guess at 3 unit perp. matrices and rewrite them to make size closest to unit and the three directions closest to orthogonality). Let us know how it goes Lewis