Path: chuka.playstation.co.uk!news From: "Nick Slaven" Newsgroups: scee.yaroze.freetalk.english Subject: Re: Sprite direction Date: Thu, 30 Aug 2001 18:44:47 +0100 Organization: IO Productions Ltd Lines: 25 Message-ID: <9mlu56$h6i5@www.netyaroze-europe.com> References: <9mlnpu$h6i2@www.netyaroze-europe.com> <9mlooj$h6i3@www.netyaroze-europe.com> <9mlpsn$h6i4@www.netyaroze-europe.com> NNTP-Posting-Host: host213-123-222-24.in-addr.btopenworld.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 a vector is basically a line going from one place to another and is denoted by its length in x and y (and z in 3d). so a vector going from 0,0 to 2,2 is denoted as 2,2, and one going from 4,5 to 2,3 is -2,-2. for your joystick code, it is just the difference in values of x and y from its rest position. Actually arcTan is a bad function to use due to the fact that you can end up with a value of infinity along the x axis (assuming Tan alpha=dx/dy). arcCos is better as it will give you negative values for a vector pointing backwards, and to get angles greater than 180deg , you need to test the value of dx and add PI to the result, or make the resultant angle negative. Did someone do a tutorial on vectors here? "Chris Wallace" wrote in message news:9mlpsn$h6i4@www.netyaroze-europe.com... > I hate sounding dumb, but how to i get the vector? I never did like them in > maths and wouldn't know on here :( > > >