1. A head-mounted display (HMD) comprising: an electronic display configured to display content to a user wearing the HMD; an optical assembly configured to direct light from the electronic display to an exit pupil of an eye of the user; an illumination source configured to illuminate the eye with a temporally varying irradiance pattern producing a temporally distorted illumination pattern on at least a portion of the eye; an imaging device configured to capture the temporally distorted illumination pattern that is associated with the portion of the eye, the imaging device including a detector comprising a plurality of pixels, each pixel is associated with multiple storage units for capturing light signals related to the temporally distorted illumination pattern captured in multiple time instants; and a controller coupled to the imaging device, the controller configured to: determine one or more phase differences between the temporally distorted illumination pattern and the temporally varying irradiance pattern, based on the light signals captured in the storage units associated with one or more pixels of the detector, calculate one or more distances from the detector to one or more surfaces of the eye, based on the determined one or more phase differences, update a model of the eye based on the determined one or more distances, and estimate a position and orientation of the eye based on the updated model.