Peter, On Mon, 26 Jun 2006 09:23:18 -0400, Peter Todd wrote: >... > Nah, what I'm really worried about for that wireframe project > is I have to figure out the math to take a x,y,z reading from an > acellerometer and convert it into a two part roll (whatever is the > proper terminology for that) to rotate my wireframe model. > > Don't have the clue how I'm going to do it. Don't even know if it's an > easy problem or a hard one. At least with an education that touched it > I'd have a vague memory of where to start, even if it took me another 4 > days to relearn all the details I'd forgotten! Isn't it fairly straightforward Trigonometry? Solve the vector for x & y then for this and z? Where: x is the magnitude of the x-axis movement (have to resolve the previous speed and the current acceleration into a distance moved in a fixed, small, time period) y is the magnitude of the y-axis movement z is the magnitude of the z-axis movement By Pythagoras: A = SQRT(x^2 + y^2) this is the magnitude of the resultant of x and y. The angle between this resultant and the x axis is arcTan(y / x) B = SQRT(A^2 + z^2) this is the magnitude of the final resultant. The angle between this and the x-y plane is arcTan(z / A) So you now know how far to move (B), and the direction to move (the two angles). You'll have to work out the signs to get the overall direction right, but a quick test should soon solve that - probably quicker than thinking it through! :-) Of course, it's over thirty since I did this stuff, but it flashed back to me. Hopefully correctly, but you never know! :-) As for the matrix calculations, you're on your own - I haven't done those since I was 11... Cheers, Howard Winter St.Albans, England -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist