Path: chuka.playstation.co.uk!news From: sceetech Newsgroups: scee.yaroze.programming.libraries Subject: Re: Rotation Matrix Functions Date: Mon, 07 Apr 1997 12:24:29 +0100 Organization: SCEE Lines: 52 Message-ID: <3348D96D.289@interactive.sony.com> References: <01bc4074$bd79ee80$d603e8c3@fred> <334A0C83.5959@micronetics.com> 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) Jim wrote: > > Hi Mike, > > I've also seen this. > > Are you directly additive modifying the matrix (coord.m i think) element > of GsCOORDINATE2 for each frame? I think your objects are scaling > because of a small error creeping in for each rotation operation. > Because you are modifying the same matrix for every frame the error get > bigger and bigger until every thing starts freaking out. :-) > > If you take a copy of the initial matrix each frame and modify that with > the rotation metrics you should be ok. I don't think this will apply to > translation. > > For example rather than rotating an object 50 degrees on frame one and > by another 50 the next, > First rotate by 50 from the initial matrix, then by 100 again from the > initial for the next frame. > This will stop the error multiplying into one huge climax! :-) > > This may make no sense just yet because its monday morning before > coffee. I'll reread this this afternoon and post an errata then. :-) > > Regards > > Jim > It is right that cumulative changes to a matrix are liable to progressively distort it due to accumulating errors in integer approximations; these distortions will have the effect of scaling and shearing 3d polygon models. Solutions to this: (i) if only ever rotating a model in one plane, can just store a single angle on that plane; each frame, regenerate the matrix from the original matrix and the angle, thereby ensuring minimal and constant error (ii) if rotating in more than one plane, this approach cannot be used because the order of rotations matters; building and using an ordered list of rotations quickly becomes too inefficient and cumbersome. One way to deal with this is to monitor the error: eg every N frames, inspect the matrix, look at it as 3 vectors, one per axis of the the object; usually each started off life with size ONE (ie 4096), hence test the actual sizes and rescale to ONE if necessary. Les than ideal, but does prevent runaway errors. Lewis