Created
January 9, 2015 22:18
-
-
Save dgfitch/389aaf7f97e9813160a4 to your computer and use it in GitHub Desktop.
Example of drawing left and right eye data in gcCursor psychopy example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while run_trial is True: | |
imageStim.draw() | |
# Additional debug dumping crap | |
data=tracker.getLastSample() | |
if data: | |
gaze_dot_left.setPos([data[11],data[12]]) | |
gaze_dot_left.draw() | |
gaze_dot_right.setPos([data[30],data[31]]) | |
gaze_dot_right.draw() | |
# Get the latest gaze position in display coord space.. | |
gpos=tracker.getPosition() | |
if type(gpos) in [tuple,list]: | |
# If we have a gaze position from the tracker, | |
# redraw the background image and then the | |
# gaze_cursor at the current eye position. | |
# | |
gaze_dot.setPos([gpos[0],gpos[1]]) | |
gaze_dot.draw() | |
# Flip video buffers, displaying the stim we just | |
# updated. | |
# | |
flip_time=window.flip() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment