Normally one would use two 3-axis accelerometers and some signal processing to get a full 6-DOF (Degree Of Freedom) tracker, but there is a simple trick that uses only one. What you do is you obtain pitch, roll, and yaw from the gravity vector, or low-pass-filtered component, and the X, Y, and Z from the dynamic acceleration, or high-pass-filtered component. It isn't perfect but it does save you a sensor