Path: chuka.playstation.co.uk!news From: "Darren Jackson" Newsgroups: scee.yaroze.beginners Subject: Re: angles, angles Date: Thu, 19 Nov 1998 20:24:17 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 57 Message-ID: <731up3$olq9@chuka.playstation.co.uk> References: <72spa7$dvm12@chuka.playstation.co.uk> <72sr28$dvm13@chuka.playstation.co.uk> <3652971c.228584498@news.playstation.co.uk> NNTP-Posting-Host: client15e0.globalnet.co.uk X-Newsreader: Microsoft Outlook Express 4.72.3115.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Richard Cutting wrote in message <3652971c.228584498@news.playstation.co.uk>... >On Tue, 17 Nov 1998 21:50:40 -0000, "Darren Jackson" > wrote: > >>HHmmm... >> >>The previous message isn't quite right, I am confusing myself at the minute >>!! >> >>The thing is how do I get the correct x and y values according to the angle. >>I know that x and y can only be integers but I need to know how many pixels >>across for every one up, for example. ( I have had a hard day at work and I >>trying to figure this out now!!). >> >>Darren >> >> > >To compute the trajectory the following bit of maths is used; > >xv = sin( angle ) * magnitude >yv = cos( angle ) * magnitude > >( where angle is the angle relative to the horizon and magnitude is >the overall speed of the sprite in pixels per game cycle ) > >If you apply xv and yv to your sprites x and y co-ordinates the sprite >will move in a straight line path from its point of origin. > >To get around the floating point problem you'll need a fixed point >trig library. There are a couple floating around, two I know of can >be found at http://www.netyaroze-europe.com/~shaughnj or >http://www.netyaroze-europe.com/~nslaven > >Richard. > I understand the maths, no problem, its just the fixed point trig that I am trying to get my head around. At the moment I am trying to use the rotation element of the sprite structure to give me an angle ? And then using this in the trig equations to give x and y. But what do I have to do to the rotation value to make it meaningful to use in trig. ONE=4096=1degree, right? should I convert to degrees before using it in sin and cos? Darren