Skip to content

Instantly share code, notes, and snippets.

@dgfitch
Created January 9, 2015 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgfitch/389aaf7f97e9813160a4 to your computer and use it in GitHub Desktop.
Save dgfitch/389aaf7f97e9813160a4 to your computer and use it in GitHub Desktop.
Example of drawing left and right eye data in gcCursor psychopy example
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