Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Dugyu committed May 17, 2019
1 parent a320e7f commit 495bace
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 51 deletions.
12 changes: 6 additions & 6 deletions Assets/Scenes/EffaceTest.unity
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 245713643}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 10, y: 20, z: 60}
m_LocalPosition: {x: 10, y: 40, z: 60}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 534669905}
Expand Down Expand Up @@ -6090,7 +6090,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1788138695}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 10.967618, y: 0.80944985, z: -1.6560266}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
Expand All @@ -6103,7 +6103,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1788138695}
m_Enabled: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bd95cfd9b8630ab4cb6b35b263561edc, type: 3}
m_Name:
Expand All @@ -6118,7 +6118,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1788138695}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1e990110f4283f645b8fd3bb795452bd, type: 3}
m_Name:
Expand Down Expand Up @@ -6146,7 +6146,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1788138695}
m_Enabled: 0
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 46cd016dca1070142974e68dfc14cd9b, type: 3}
m_Name:
Expand All @@ -6160,7 +6160,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1788138695}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8caa3165744e9bb489d6faa4bf979bbe, type: 3}
m_Name:
Expand Down
28 changes: 19 additions & 9 deletions Assets/Scripts/Movement/EyeRay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ public class EyeRay : MonoBehaviour

public GazePoint _gazePoint;

void Start()
{
}

void Update()
{

Expand All @@ -29,11 +25,11 @@ void Update()
if (_gazePoint.IsValid) {

ray = cam.ScreenPointToRay( new Vector3(_gazePoint.Screen.x, _gazePoint.Screen.y));

if (Physics.Raycast(ray, out hit))
{
Transform objectHit = hit.transform;
Vector3 hitPoint = hit.point;
Debug.Log(objectHit.tag);

if (objectHit.transform.tag == "Neuron")
{
Expand All @@ -47,19 +43,33 @@ void Update()
}


//instTarget = objectHit.position;
instTarget = hitPoint;
smoothTarget = smoothTarget * (1.0f - targetingSpeed) + instTarget * targetingSpeed;

player.transform.LookAt(smoothTarget, Vector3.up);
if (player.transform.forward == Vector3.up)
{
player.transform.LookAt(smoothTarget, Vector3.back);
}
else
{
player.transform.LookAt(smoothTarget, Vector3.up);
}
}

else
{
// Imagine the hit point falls on an invisible globe
Vector3 hitPoint = ray.GetPoint(512.0f);
instTarget = hitPoint;
smoothTarget = smoothTarget * (1.0f - targettingSpeed) + instTarget * targettingSpeed;
player.transform.LookAt(smoothTarget, Vector3.up);

if (player.transform.forward == Vector3.up)
{
player.transform.LookAt(smoothTarget, Vector3.back);
}
else
{
player.transform.LookAt(smoothTarget, Vector3.up);
}
}
}

Expand Down
36 changes: 25 additions & 11 deletions Assets/Scripts/Movement/MouseRay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,37 @@ public class MouseRay : MonoBehaviour
Vector3 smoothTarget;



void Start()
{

}

void Update()
{

float targetingSpeed = targettingSpeed;

ray = cam.ScreenPointToRay(Input.mousePosition);

if (Input.mousePosition.x < 1160 && Input.mousePosition.x >760 && Input.mousePosition.y < 640 && Input.mousePosition.y > 440)
{
targetingSpeed = 0.001f;
}


ray = cam.ScreenPointToRay(Input.mousePosition);

if (Physics.Raycast(ray, out hit))
{
Transform objectHit = hit.transform;
Vector3 hitPoint = hit.point;


//instTarget = objectHit.position;
instTarget = hitPoint;
smoothTarget = smoothTarget * (1.0f - targetingSpeed) + instTarget * targetingSpeed;

player.transform.LookAt(smoothTarget, Vector3.up);
if (player.transform.forward == Vector3.up)
{
player.transform.LookAt(smoothTarget, Vector3.back);
}
else
{
player.transform.LookAt(smoothTarget, Vector3.up);
}

if (objectHit.transform.tag == "Neuron")
{
Expand All @@ -47,7 +53,6 @@ void Update()
objectHit.GetComponent<MeshRenderer>().material.color = lerpColor;

player.transform.Translate(player.transform.forward * 5.0f * Time.deltaTime, Space.Self);

}


Expand All @@ -58,7 +63,16 @@ void Update()
Vector3 hitPoint = ray.GetPoint(512.0f);
instTarget = hitPoint;
smoothTarget = smoothTarget * (1.0f - targettingSpeed) + instTarget * targettingSpeed;
player.transform.LookAt(smoothTarget, Vector3.up);

if (player.transform.forward == Vector3.up)
{
player.transform.LookAt(smoothTarget, Vector3.back);
}
else
{
player.transform.LookAt(smoothTarget, Vector3.up);
}

}

}
Expand Down
6 changes: 0 additions & 6 deletions Assets/Scripts/Movement/TobiiEye.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Assets/Scripts/Movement/TobiiEye.cs.meta

This file was deleted.

2 changes: 1 addition & 1 deletion Assets/Scripts/Particle Class/Flow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void Update()
foreach (Memo memo in memos)
{
memo.Attract(strength);
Debug.Log(memo.targetNeuron.id);
//Debug.Log(memo.targetNeuron.id);
memo.Update();
}

Expand Down
1 change: 1 addition & 0 deletions Assets/Scripts/Particle Class/PresenceMeEye.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ void Start()
{

_gazePoint = TobiiAPI.GetGazePoint();

lastInput = new Vector3(Screen.width * 0.5f, Screen.height * 0.5f);

baseline = Mathf.Sqrt(Screen.width * Screen.width + Screen.height * Screen.height);
Expand Down
6 changes: 0 additions & 6 deletions Assets/Scripts/Particle Class/PresenceOfMe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ void Update()
{
Vector3 difference = Input.mousePosition - lastInput;




float waveValue = 1.0f - difference.magnitude / baseline;


Expand All @@ -40,9 +37,6 @@ void Update()

lastInput = Input.mousePosition;




brush.localScale = new Vector3(20.0f * Mathf.Sin(Time.realtimeSinceStartup), 10.0f * Mathf.Sin(Time.realtimeSinceStartup), 16.0f * Mathf.Sin(Time.realtimeSinceStartup));
brush.localScale *= waveValue;
brush.gameObject.GetComponent<MeshRenderer>().material.color = new Color(Mathf.Sin(Time.realtimeSinceStartup) * 0.72f, 0.267f, 0.267f);
Expand Down
37 changes: 36 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
@@ -1 +1,36 @@
A Shared Landscape Responsive to Existence
A Shared Landscape Responsive to Existence

1. Download an install the Tobii Eye Tracker driver (Tobii Eye Tracking Core Software v2.16.4

) at https://gaming.tobii.com/getstarted/

after installation finished, calibrate the eye tracker to your eyes.

2. Download the EFFACE master folder.

There are two ways to test out the project:

a. Using Build Standalone Excutable File (Windows Only):

a.1 Using eye gaze as input
unzip Efface_Win_Eye inside Efface/Builds
Run Efface.exe.

a.2 Alternatively, you can use mouse as input
unzip Efface_Win_Mouse inside Efface/Builds
Run Efface.exe.


b. Using Unity Editor (Windows Only).

b.1 Go to Unity download site, choose the *exact* version 2018.3.8f1.
https://unity3d.com/get-unity/download/archive
In the selection tab at the bottom of the page, select 2018.x, then scroll down, select 2018.3.8, choose "Downloads(Win)".

b.2 Install the downloaded file.

b.3 Open the EffaceTest.unity file in Efface\Assets\Scenes.

b.4 Click the "Scripting" object in the hierarchy, enable "Mouse Ray" and "Presence of Me" scripts in the inspector to interact using mouse input, or disable them, enable "Eye Ray" and "Presence of Me Eye" scripts in the inspector to interact using eye gaze input.

b.5 Click run button in the editor.

0 comments on commit 495bace

Please sign in to comment.