1. A camera-based touch sensor comprising: a glossy surface that reflects light in a mirror-like fashion and upon which a user performs input gestures to control an electronic device; a camera aimed at least at a portion of said surface along a line of vision such that when a pointer is near said surface the camera captures a two-dimensional pixel image of the pointer and a reflection of the pointer by said surface, the pointer having a pixel location (px, py) and the reflection of the pointer having a pixel location (rx, ry) in the pixel image; and a processor coupled with said camera configured to determine a three-dimensional location (X,Y, Z) of the pointer relative to said surface, by: determining a two-dimensional location (X, Y) of the projection of the pointer onto said surface, by (i) projecting (px, py) in the pixel image onto a first axis that is perpendicular to said camera's line of vision, and (ii) projecting the mid-point between (px, py) and (rx, ry) in the pixel image onto a second axis that is parallel to said camera's line of vision, and determining a height, Z, of the pointer above said surface based on the distance between (px, py) and (rx, ry) in the pixel image.