Path: chuka.playstation.co.uk!news From: James Russell Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: Rotating about an arbitrary axis? Date: Wed, 23 Sep 1998 10:34:04 +0100 Organization: Sony Computer Entertainment Europe Lines: 34 Message-ID: <3608C08C.217EA9C8@scee.sony.co.uk> References: <36028A8D.290E@manc.u-net.com> <36028CB6.F017A2D5@scee.sony.co.uk> <3607A680.5844@mdx.ac.uk> <6u9a0d$bdk4@chuka.playstation.co.uk> NNTP-Posting-Host: mailgate.scee.sony.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5b1 [en] (Win95; I) X-Accept-Language: en Nick Slaven wrote: > > >james, let me know if this works. I (think) I had a problem with the > >seperate RotMarix functions and never went back to them (had to use the > >slower RotMatrix() a few times to get the same effect) > > Me too, they seemed to completely distort the tmds (from what I remember) in a > totally unexpected way, whilst rotmatrix always works. I'm puzzled by this - I use them all the time with no problems. Probably the thing to remember is that the matrix you pass to RotMatrixX/Y/Z is both input AND output. It multiplies the input matrix by the appropriate rotation matrix, it doesn't create one from scratch (whereas RotMatrix does). So therefore if you want a X followed by Y rotation, you'd go: MATRIX MyRotation = { { 1, 0, 0 }, // Identity matrix { 0, 1, 0 }, { 0, 0, 1 } }; RotMatrixX(firstAngle, &MyRotation); RotMatrixY(secondAngle, &MyRotation); and there you go. Is this what you were doing? Cheers, James -- == James_Russell@scee.sony.co.uk +44 (171) 447-1626 == Developer Support Engineer - Sony Computer Entertainment Europe On the other hand, the early worm gets eaten.