1. A computer-readable medium encoded with a computer program comprising instructions that, when executed, operate to cause a computer to perform operations comprising: defining a shape within motion data; sampling the motion data at points that are aligned with the defined shape; determining whether a moving object is performing a gesture correlating to the defined shape based on a pattern exhibited by the sampled motion data; and controlling an application if determining that the moving object is performing the gesture.