Eye Tracking Coordinates

Coordinate System


The coordinate system used in Vizard is a 3D Cartesian coordinate system, which means it is composed of three perpendicular axes labeled X, Y, and Z.


In Vizard, the origin of the coordinate system is located at the center of the virtual environment. The positive X-axis extends to the right, the positive Y-axis extends upward, and the positive Z-axis extends outward from the screen. 


The units used in Vizard's coordinate system are in meters. 


These coordinates are specified relative to the parent object's coordinate system, which means that objects can be nested and their coordinates will be adjusted accordingly.


Overall, the Vizard coordinate system works like any other 3D Cartesian coordinate system, with the added capability of being able to manipulate virtual objects in a virtual environment.


For a breakdown of the specific code where the eye tracking coordinates are being set, this is in the “updateGaze” function in the “sightlab” module. Here’s a detailed breakdown: 


def updateGaze():

    gazeMat = eyeTracker.getMatrix()

    gazeMat.postMult(viz.MainView.getMatrix())

    line = gazeMat.getLineForward(1000)

    info = viz.intersect(line.begin, line.end)

    global flag, writeToggle


    gazeTime.updateGazeObject(info.object)

    currentTime = viz.tick() - startTime

    

    if info.valid:

        data = [currentTime, info.point, viz.MainView.getPosition(), flag]

        objects[1].setPosition(info.point)

    else:

        fake_info = [0.00, 0.00, 0.00]

        data = [currentTime, fake_info, viz.MainView.getPosition(), flag]


Here's a breakdown of what the code is doing: