TRACKPixx Demo 3 -- Creating a circular gaze-contingent mask with the TRACKPixx3 ===================================================================================== .. Note:: This demo requires TRACKPixx Revision 18 or later. You can check for recent firmware updates at vpixx.com/whatsnew This demo continuously samples eye position from the TRACKPixx3 eye tracker and uses it to update the location of a circular grey mask obscuring part of the displayed image. The mask is tied to the left eye position; participants can use the arrow keys to offset mask location, and "Q" and "A" keys to adjust the size of the mask. At the beginning of the demo there is an optional calibration step. This step calls ``TPxTrackpixx3CalibrationTesting``, which implements a standard MATLAB TRACKPixx3 calibration script. The tracker must be calibrated for every new participant. We also recommend calibrating if a participant moves away from the chinrest. While other TRACKPixx demos use the eye-tracking schedule and store data on the I/O controller for later access, this demo does not record eye position. Instead, it repeatedly samples the tracker with ``GetEyePosition``, which calls the most recent eye-tracking data available. Because this sampling is performed within MATLAB, rather than the I/O controller, eye positions cannot be recorded at the maximum rate of 2000 samples/second. Because we draw our frames at a much slower rate, this is fine for our gaze contingent display. No eye position data is saved. Psychtoolbox's "Screen" coordinates define the origin (x, y = 0, 0) as the top left corner of the display. In contrast, the TRACKPixx treats the center of the display as the origin. The ``ConvertCoordSysToCustom`` converts the eye position in tracker coordinates into screen coordinates so that the mask is drawn at the correct location on the display. For more details, please see the documentation for ``ConvertCoordSysToCustom``. .. literalinclude:: ../DatapixxToolbox/DatapixxDemos/TPxScotomaDemo.m :language: matlab :emphasize-lines: 30-33, 37, 79-88, 127 :linenos: