Path: chuka.playstation.co.uk!news From: "Matt Verran" Newsgroups: scee.yaroze.freetalk.english Subject: Re: floating points Date: Mon, 12 Mar 2001 00:14:40 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 42 Message-ID: <98h4bg$7i12@www.netyaroze-europe.com> References: <98gt47$7i5@www.netyaroze-europe.com> <98h1ht$7i6@www.netyaroze-europe.com> <98h21o$7i8@www.netyaroze-europe.com> <98h27t$7i9@www.netyaroze-europe.com> <98h3g2$7i10@www.netyaroze-europe.com> NNTP-Posting-Host: host213-122-224-225.btinternet.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 > Not sure about Matrix rotation, what i'm doing is moving sprites round in a > circle, I haven't done any Matrix stuff yet, I'm sure you will all know when > I do :-) I always used to use the Sin/Cos lookup option for loads of stuff, I cut my teeth AMOS too funnily enough :) But after playing about with 3d stuff I realised I could use the 3d functions for everything I'd used sin/cos for and it was way faster and more flexible. If say you wanted to rotate about a circle with radius 50: startVector.vx = 50; startVector.vy = 0; startVector.vz = 0; rotateVector.vx = 0; rotateVector.vy = 0; rotateVector.vz = 64; RotMatrix(&rotateVector, &matTmp); ApplyMatrixSV(&matTmp, &startVector, &resultVector); x = currentDirection.vx; y = currentDirection.vy the "startVector.vx = 50; startVector.vy = 0;" bit specifies your start position (rotation about 0,0). The value in rotateVector.vz specifies how much you want to rotate (4096 is one complete rotation). "x" and "y" are your new rotated values. The beauty of this is that you can piss about with the radius of the circle really easily (something that would require a big lookup table or some kind of scaling with sin/cos), it's super fast and it lets you rotate about x and y too so you can get going into and out of the screen bonkers style effects :) MattV