If you’ve gone through the lessons might be asking yourself – where does the ipad accelerometer data come from?
The answer is pretty simple. If you have javascript experience, then you will know that the window has listeners for different events, such as onload and onmousedown. The mobile browser adds other event listeners like the ontouch events.
It also adds one special one called ondevicemotion. In iOS, this event has acceleration variables. To make these work in processing we simply create an ipad object and update its accelerationX, accelerationY,...
Read more...