Path: chuka.playstation.co.uk!news From: "Kenny Millar" Newsgroups: scee.yaroze.freetalk.english Subject: Re: Maths Functions? Date: Mon, 27 Aug 2001 18:53:50 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 37 Message-ID: <9me19v$1sb12@www.netyaroze-europe.com> References: <9mdpv0$1sb3@www.netyaroze-europe.com> <9mdqcu$1sb4@www.netyaroze-europe.com> <9mdt9h$1sb6@www.netyaroze-europe.com> <9mduur$1sb9@www.netyaroze-europe.com> <9mdvpo$1sb11@www.netyaroze-europe.com> NNTP-Posting-Host: pc2-kirk2-0-cust187.ren.cable.ntl.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2462.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000 Hi Chris, A look up tabel is just a fancy name for an array. Lets say the stick can move 1cm up, down, left and right. Then a value of 0 from the stick would be 1 cm left, a value of 255 would be 1 cm right. Therefore each value represents 128th of a cm. (which is 0.0078125 of a cm) Build an array like this: float x_pos[256] Then during initialisaztion populate each element of the array with the distance the stick moves. for (int z = 0; z<256;z++) { x_pos[z]= -1 + (0.0078125 * z); } then to read the distance the stick has moved, just look up the element number which represents the value from the pad. For example, is the pad value was 123, your distance would be x_pos[123] Hope this helps! -Kenny "Chris Wallace" wrote in message news:9mdvpo$1sb11@www.netyaroze-europe.com... > Urm probably... ive never used a look up table... > How do they work? > >