Where you can not look at..

Yankun yang
Data Mining the City
3 min readSep 25, 2019

It’s never been bothering me so much since I realized that people in New York City, or any big city, tend to avoid to look into others’ eyes.

In most cases, because of the emergence of cellphones(almost like a mini mobile computer), people tend to swipe open their phone to pretend to be busy with attending other matters while sharing small spaces with others. The most typical spaces are elevators, uber pools, buses, and subways.

Subway is the idea that came across my mind because of the subways in new york don’t provide internet signals! The moment people are carried away from the platform, they are cut off from the world. A few smart people bring books to read in order to avoid making eye contacts, and some people tend to stare at the loading page of their phones, but most of the people are playing the game of finding the most comfortable spot where no one else occupied and looking back at them.

Agents : Subway Passengers

Environment : NYC subway

Behavior : Vision wandering while avoiding direct eye contacts with other passengers.

Parameters: Normal human vision cone -45–45 degrees

Inputs: Number of passengers, vision moving away radius, positions of passengers.

Output: Vision focus that attempts to locate at somewhere no one else looking directly back.

The simulation is supposed to be very simple as below :

Each person will have a cone vision of -45–45 degrees.

Around Y axis and X axis.

Every person will scan the environment constantly to look for “comfy spot”

If their visions interact with another one, all the involved ones will move their sight in random range -15–15 degrees to avoid constantly staring at someone.

Eventually, although I haven’t got to there yet. The result should tell the exact spots that people choose to comfortably have their eyes to stay, and the spots are going to be perfect locations for advertisement.

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class behavior : MonoBehaviour

{

GameObject people2;

public float strength = 10f;

public float rotationSpeed = 1f;

public float rayLength = 10f;

public float angle = 0.25f;

private Quaternion randomRotation;

// Start is called before the first frame update

void Start()

{

people2 = GameObject.Find(“people2”);

}

// Update is called once per frame

void Update()

{

randomRotation = Quaternion.Euler(Random.Range(-45, 45f), Random.Range(-90f, 90f), 0.0f);

transform.localRotation = Quaternion.Slerp(transform.localRotation, randomRotation, Mathf.Sin(Time.deltaTime * rotationSpeed));

Vector3 lookDir = transform.position — people2.transform.position;

Vector3 myDir = transform.forward;

Vector3 yourDir = people2.transform.forward;

float myAngle = Vector3.Angle(myDir, lookDir);

float yourAngle = Vector3.Angle(yourDir, -lookDir);

Debug.DrawRay(transform.position, myDir * rayLength, Color.red);

Ray ray = new Ray(transform.position, myDir);

//angle between people2’s front sight and people

if (myAngle < angle && yourAngle < angle)

{

//rotate the rotations away

Quaternion awayRotation = Quaternion.LookRotation(myDir);

Vector3 euler = awayRotation.eulerAngles;

euler.y = Random.Range(-15,15);

awayRotation = Quaternion.Euler(euler);

//rotate objects away

transform.rotation = Quaternion.Slerp(transform.rotation, awayRotation, rotationSpeed * Time.deltaTime);

transform.eulerAngles = new Vector3(0, transform.eulerAngles.y, 0);

}

}

}

--

--