Are you trying to create a 3D program for the iPhone? (There are already several.) Can you accurately describe what kind of user movement you want to correspond to which action?
The easiest way to do this is to get the device step by taking the arc cosine of the point product of the acceleration vector with (0, 0, 1000).
If you are trying to implement a device in which a sliding iPhone moves the cursor back and forth across the screen in space, it will be difficult, because it will require relatively violent hand movements to create large accelerations to gravitational acceleration. MEMS accelerometers, such as those on the iPhone, look great at measuring gravity, but are pretty bad at measuring the actual accelerations of the device itself.
If you describe your application a bit, I can give you more specific pointers.
There are many different ways to represent spatial rotations, but quaternions are very popular in the gaming programming community. A google search gives you some links to some primers. GamaSutra is a good place to start.
http://www.gamasutra.com/features/19980703/quaternions_01.htm http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation http://www.flipcode.com/documents/matrfaq.html
source share