Path: chuka.playstation.co.uk!news From: James Russell Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: Vectors and Matrices Mini Tutorial Date: Fri, 10 Jul 1998 09:18:11 +0100 Organization: Sony Computer Entertainment Europe Lines: 41 Message-ID: <35A5CE43.25049F22@scee.sony.co.uk> References: <35A25BBF.F272A126@scee.sony.co.uk> <35a2e6c8.59132342@news.scea.sony.com> <35A349BF.1C739D7D@scee.sony.co.uk> <35a42c22.89797019@news.scea.sony.com> <35A48348.930D42AF@scee.sony.co.uk> <35a5230a.92033316@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: > > >They are both correct! It all depends on which side you are multiplying your 3D vector from. > >Call your matrix (the top one) A, and my matrix (the bottom one) B, and the vector we're multiplying > >by C. > By the proof, it looks like it should work for any arbitrary matrix. That's the proof that A*B = Bt * At (where Bt is the transpose (or 'flipped' version) of B, and At is the transpose of A. Yes, this is true for all matrices. You've got to forgive me, I haven't done this stuff for about 4 years. :O) I was getting it confused with A-1 (the inverse of A). For those that don't know, the inverse of a matrix A is the matrix you use to 'reverse' the transformation that A performs. For example, if A is a rotation of 90 degrees about the Z axis in the anticlockwise direction, A-1 (the inverse of A) is a rotation of 90 degrees about the Z axis in the clockwise direction. So combining the two transformations (a matrix and its inverse) gets you no transformation at all (the identity matrix). To calculate the inverse of A, you have to go through a standard horrible process of row reduction and the like. And you may not even get an answer, because some matrices don't have an inverse. However, for ORTHOGONAL matrices (like the X/Y/Z rotation matrices), the inverse can be easily found - it's just the transpose of the original matrix. The scaling matrix is not necessarily orthogonal (and exactly what makes a matrix orthogonal escapes me for now). But the inverse of a scaling matrix is just all the terms along the diagonal to the power of -1. From what I've said above, we can make a few equalities. Because sin(t) = -sin(t) and cos(t) = cos(-t), and the rotation matrix Rz (rotation about Z, or X/Y for that matter) is orthogonal: If a is an angle of rotation: Rz(a) = Rz(-a)t (the transpose of Rz(a)) Rz(a)-1 (the inverse of Rz(a)) = Rz(a)t = Rz(-a) -- == James_Russell@scee.sony.co.uk +44 (171) 447-1626 == Developer Support Engineer - Sony Computer Entertainment Europe Famous Last Words: "OK, I lit the emergency candle. Why is it red?"