Skip to content

Instantly share code, notes, and snippets.

@GEJ1
Last active May 27, 2021 18:19
Show Gist options
  • Save GEJ1/23afc1cc7df41f0b74062f3751ad9f90 to your computer and use it in GitHub Desktop.
Save GEJ1/23afc1cc7df41f0b74062f3751ad9f90 to your computer and use it in GitHub Desktop.
webgazer_demo.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>eye tracking</title>
<script src="webgazer.js" type="text/javascript" ></script>
</head>
<body>
<script>
webgazer.setGazeListener(function(data, elapsedTime) {
if (data == null) {
return;
}
var xprediction = data.x; // Coordenadas en el eje X relativas al viewport
var yprediction = data.y; // Coordenadas en el eje Y relativas al viewport
console.log(elapsedTime); //tiempo desde el momento en que se llamó a "begin"
}).begin();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment