public class GazeTrack extends Object
/* GazeTrack: Basic demo - In this demo, the user's gaze is represented by a white circle. - Before you run this demo, make sure the Tobii eye-tracker (EyeX, 4C) is connected to the computer, and that the Tobii software is running and calibrated to your eyes. Finally, make sure the 'TobiiStream.exe' is running and displaying gaze data. You can download this application from: http://web.tecnico.ulisboa.pt/augusto.esteves/GazeTrack/TobiiStream.zip by Augusto Esteves http://web.tecnico.ulisboa.pt/augusto.esteves/ https://github.com/AugustoEst/gazetrack */ import gazetrack.*; GazeTrack gazeTrack; void setup() { fullScreen(); // Gaze cursor param. noFill(); stroke(50, 100); strokeWeight(4); gazeTrack = new GazeTrack(this); // If the TobiiStream.exe asked you to use a // different socket port (e.g., 5656), use this instead: // gazeTrack = new GazeTrack(this, "5656"); } void draw() { background(255); if (gazeTrack.gazePresent()) { ellipse(gazeTrack.getGazeX(), gazeTrack.getGazeY(), 80, 80); // Print the tracker's timestamp for the gaze cursor above println("Latest gaze data at: " + gazeTrack.getTimestamp()); } }
Constructor and Description |
---|
GazeTrack(PApplet theParent)
The GazeTrack constructor (default ZMQ socket)
|
GazeTrack(PApplet theParent,
String socket)
The GazeTrack constructor (specific ZMQ socket).
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Anything in here will be called automatically when the parent
sketch shuts down.
|
boolean |
gazePresent()
Returns true if the eye-tracker is capturing
the user's gaze
|
float |
getGazeX()
Returns the user's latest gaze position (X)
|
float |
getGazeY()
Returns the user's latest gaze position (Y)
|
float |
getHeadPitch()
Returns the user's head rotation (Pitch)
|
float |
getHeadPositionX()
Returns the user's head position (X)
|
float |
getHeadPositionY()
Returns the user's head position (Y)
|
float |
getHeadPositionZ()
Returns the user's head position (Z)
|
float |
getHeadRoll()
Returns the user's head rotation (Roll)
|
float |
getHeadYaw()
Returns the user's head rotation (Yaw)
|
float |
getLeftEyeX()
Returns the user's left eye position (normalized X)
|
float |
getLeftEyeXmm()
Returns the user's left eye position.
|
float |
getLeftEyeY()
Returns the user's left eye position (normalized Y)
|
float |
getLeftEyeYmm()
Returns the user's left eye position.
|
float |
getLeftEyeZ()
Returns the user's left eye position (normalized Z)
|
float |
getLeftEyeZmm()
Returns the user's left eye position.
|
float |
getRightEyeX()
Returns the user's right eye position (normalized X)
|
float |
getRightEyeXmm()
Returns the user's right eye position.
|
float |
getRightEyeY()
Returns the user's right eye position (Y)
|
float |
getRightEyeYmm()
Returns the user's right eye position.
|
float |
getRightEyeZ()
Returns the user's right eye position (normalized Z)
|
float |
getRightEyeZmm()
Returns the user's right eye position.
|
double |
getTimestamp()
Returns the timestamp for the latest gaze event
|
boolean |
leftEyePresent()
Returns true if the eye-tracker is capturing
the user's left eye
|
boolean |
rightEyePresent()
Returns true if the eye-tracker is capturing
the user's right eye
|
public GazeTrack(PApplet theParent)
theParent
- public float getGazeX()
public float getGazeY()
public double getTimestamp()
public boolean gazePresent()
public boolean leftEyePresent()
public float getLeftEyeXmm()
public float getLeftEyeYmm()
public float getLeftEyeZmm()
public float getLeftEyeX()
public float getLeftEyeY()
public float getLeftEyeZ()
public boolean rightEyePresent()
public float getRightEyeXmm()
public float getRightEyeYmm()
public float getRightEyeZmm()
public float getRightEyeX()
public float getRightEyeY()
public float getRightEyeZ()
public float getHeadPositionX()
public float getHeadPositionY()
public float getHeadPositionZ()
public float getHeadPitch()
public float getHeadYaw()
public float getHeadRoll()
public void dispose()
Processing Library GazeTrack by Augusto Esteves. (c) Augusto Esteves