Path: chuka.playstation.co.uk!news From: James Russell Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: RotMatrixBUG???? Date: Thu, 09 Jul 1998 09:35:34 +0100 Organization: Sony Computer Entertainment Europe Lines: 42 Message-ID: <35A480D6.FA1F21A@scee.sony.co.uk> References: <01bda686$31300120$4fa1f7c2@manolo> <359D8B5E.54DE@mdx.ac.uk> <35a427fd.88736196@news.scea.sony.com> NNTP-Posting-Host: camfw01.millennium.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.05 [en] (Win95; I) Jamin Frederick wrote: > > I'm still a little confused. Why do all the matrix multiplication > correcting with the "incremental" approach (what Peter was talking > about) when you can just store the current rotation vector (where > (a,b,c) represents the model a, b,and c degrees from its local x, y, > and z axes respectively thus far) and make a "consummate" matrix from > the (a,b,c) vector and RotMatrix, which gets put in the > GsCOORDINATE2.coord matrix -- resulting in the proper orientation of > the model (since the model is in the original orientation if the coord > matrix is the identity matrix, and changing the coord matrix into a > different matrix effectively changes its orientation)? That is indeed what most people do, because it's very simple to understand. However, RotMatrix has two drawbacks: 1) The order of the rotations is fixed. It rotates about the Z first, then the Y, then the X, which isn't always what you want, but suits most people. 2) It's slower than some other methods. RotMatrix builds a 3x3 matrix from scratch every time you call it, but if you know that only some parts have changed, then writing a custom function to fiddle with a subset of the matrix can be faster. However, that brings on a couple of extra problems, like cumulative error correction and so forth, which is what Peter was talking about. > Now what do I have to do if I have a button for each rotation > direction, positive and negative around each axis, and i want to > rotate the object arbitrarily without using the "incremental" method? > Apparently I can't just increment/decrement the numbers in the (a,b,c) > vector when I push the corresponding buttons. No, that's fine. If you want to rotate your object 40 degrees MORE about the Z axis, then just add 40*4096/360 to 'c'. Cheers, James -- == James_Russell@scee.sony.co.uk +44 (171) 447-1626 == Developer Support Engineer - Sony Computer Entertainment Europe A diagnostic is someone who doesn't know if there are two Gods.