Path: chuka.playstation.co.uk!news From: "Michael Enoch" <100413.2514@compuserve.com> Newsgroups: scee.yaroze.programming.libraries Subject: Re: Rotation Matrix Functions : The Solution? Date: 10 Apr 1997 01:00:20 GMT Organization: PlayStation Net Yaroze (SCEE) Lines: 29 Message-ID: <01bc454b$1c8e8fe0$5214e8c3@fred> References: <01bc4074$bd79ee80$d603e8c3@fred> <334A0C83.5959@micronetics.com> <3348D96D.289@interactive.sony.com> <334b2016.21064909@news.playstation.co.uk> <01bc4448$a37ddc80$0b16e8c3@fred> <334BA817.4A3C@interactive.sony.com> NNTP-Posting-Host: ld37-082.lon.compuserve.com X-Newsreader: Microsoft Internet News 4.70.1155 > Take the rows (or columns) one at a time calculate the length > sqrt(x*x+y*y+z*z) > and divide the x,y,z by the length > > The problem is that 4096 is one and sqrt is slow. > All this means is that before the divide you have to multiply by 4096, > and for the sqrt, only doing one row in a frame and not every frame. > > Stuart Thanks for the explanation, I made this from it and tried it within my code: length=sqrt(Matrix->m[i][0]*Matrix->m[i][0]+ Matrix->m[i][1]*Matrix->m[i][1]+ Matrix->m[i][2]*Matrix->m[i][2]); Matrix->m[i][0]=(Matrix->m[i][0]*ONE)/length; Matrix->m[i][1]=(Matrix->m[i][1]*ONE)/length; Matrix->m[i][2]=(Matrix->m[i][2]*ONE)/length; I repeated it 3 times changing i to equal 0,1,or 2 for the rows, I wasn't too bothered about speed at the moment so I just did all 3 rows every frame. What I was wondering is whether I got it right? The reason I ask is that the object still changes shape/whatever slightly. Am I just being picky or have I done something wrong? It doesn't seem as bad as before but I thought I'd ask anyway to make sure. Thanks for your trouble, Mike.