Path: chuka.playstation.co.uk!news From: "John \( QuietBloke \)" Newsgroups: scee.yaroze.freetalk.english Subject: Re: Matrix Date: Wed, 8 Aug 2001 01:36:50 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 89 Message-ID: <9kq1jr$3h32@www.netyaroze-europe.com> References: <9k3qu6$6qb1@www.netyaroze-europe.com> <9k3u6h$6qb4@www.netyaroze-europe.com> NNTP-Posting-Host: host213-122-115-221.btinternet.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Nice thread.. Id been meaning to implement a matrix method as apposed to a lookup table for a while but I never seemed to get round to it.. this was just the thing to nudge me into doing it. The only thing is.. and it may just be me being dim.. but the matrix requires an angle 0-4095 = 0-360 degrees whereas for a sprite the rotation is supplied as 4096 = 1 degree. So now I end up storing the angles for each actor but having to multiply it by 360 for each sprite I draw. Just seems a bit of a waste of CPU time.. why cant the sprite use the same method to supply an angle ! There is probably a very good reason but I tend to get a bit grumpy at this time of night... anyway.. thanx for the sample code Matt.. it all sudenly becomes crystal clear and simple... and Im embarressed I never implemented this before. Cheers PS.. Im hoping for a new demo to be ready real soon now... its gone real quiet I hope all is going well with everyone elses games. "Matt Verran" wrote in message news:9k3u6h$6qb4@www.netyaroze-europe.com... > No you don't need to call GsInit3D to use the matrix stuff. > > Here's a function I use instead of sin/cos or lookups: > > int RotPosX(int size, int r) > { > MATRIX matTmp; > SVECTOR startVector; > SVECTOR rotateVector; > > startVector.vx = size; startVector.vy = 0; startVector.vz = 0; > rotateVector.vx = 0; rotateVector.vy = 0; rotateVector.vz = r; > > RotMatrix(&rotateVector, &matTmp); > ApplyMatrixSV(&matTmp, &startVector, &rotateVector); > > return rotateVector.vx; > } > > (NB: the 'r' parameter 4096=360 degrees) > > > to do: > X = 60 * Sin(90) > > using my function: > X = RotPosX(60, 1024) > > Basically the function rotates the startVector about the Z axis (so it's X > and Y values are changed), only the X value is returned, but the Y value is > just the same shifted 90 (1024) degrees, just like sin/cos. > > No problem giving further help, just ask... > MattV > > > > Nigel Critten wrote in message > news:9k3qu6$6qb1@www.netyaroze-europe.com... > > I've been looking at my highscore name entry and its a bit boring, being > > based on one I did back in 94 :) so I want to make it look flash, at the > > moment I'm using a lookup table, If you look back you will find a thread > on > > Floating Points that was in March and I've been using a lookup since then > > meaning to get into Matrix stuff but never getting round to. > > > > But this is the time, Matt V if you can hear me help... you gave a good > > explanation back then but I need more help :) > > > > Right basic stuff first, do I need to GsInit3D, there is no mention in the > > manual that I can see that needs Init3D for the Matrix stuff? > > > > Are there any nice demos about showing off the basics of this stuff. > > > > Cheers > > Nigel > > > > > >