# Kinetic Interfaces:Midterm–Moon(Candy Bi)

Documented by: Candy Bi Project name: My Universe Professor: Moon Date: 10/31/2018 Target: Code to create an interactive experience. Code: https://drive.google.com/open?id=1i1kuhfcdE_uB5UdD0Pc2a4grjQr5f3PA

# Assignment: Personal Kinetic Sculpture

My personal kinetic sculpture: Metamirror             This rough sketch encapsulates the idea that is my kinetic sculpture. I named is metamirror as it is in a sense a metallic mirror. This sculpture can my place in any place with direct sunlight like an outdoor area or underneath a sunroof.  Each […]

# Kinetic Interfaces- Midterm Project (Moon)

Name: Mehr Un Nisa Javed Professor: Moon Date: 2nd November’2018 Objective: Use one of the interaction learnt in the class to develop it further into a midterm project. Title: “High School Musical” Here is my initial idea which I had when I made the Concept Presentation: https://docs.google.com/presentation/d/1nPUh8OmwZWrOb3E8xBXx4bFP6jtO6aheJUJ3CuZLU3o/edit?usp=sharing Inspiration for the Project: In my childhood I used to watch […]

# Kinetic Interfaces – week 6: Leap Motion (Emerald)

For this assignment we are going to use the leap motion and to create some interaction between screen and hand movement. I’m really interested in the gesture, so I tried the grab gesture this time. Basically I build a simple interaction, that user can move his hand and grab the small ball, which are randomly generated, […]

``````float handX, handY;
float HG;

ArrayList<Ball> balls = new ArrayList<Ball>();

void setup() {
size(600, 600);
background(255);

leapMotion_setup();

for (int i=0; i<2; i++) {
balls.add(new Ball(random(100, width-100), random(100, height-100), color(random(255), random(255), random(255))));
}
}

void draw() {
background(255);
leapMotion_draw();

for (int i=0; i<balls.size(); i++) {
Ball b = balls.get(i);
b.display();
}

float dis1 = dist(balls.get(0).x, balls.get(0).y, handX, handY);
float dis2 = dist(balls.get(1).x, balls.get(1).y, handX, handY);

if (dis1 < 50 && HG > 0.6){
balls.get(0).x = handX;
balls.get(0).y = handY;
}

if (dis2 < 50 && HG > 0.6){
balls.get(1).x = handX+10;
balls.get(1).y = handY+10;
}

}

class Ball {
float x, y;
color c;

Ball(float _x, float _y, color _c) {
x = _x;
y = _y;
c = _c;
}

void display() {
noStroke();
fill(c);
ellipse(x, y, 40, 40);
}
}

import de.voidplus.leapmotion.*;

LeapMotion leap;

void leapMotion_setup() {

leap = new LeapMotion(this);

}

// ======================================================
// 1. Callbacks

void leapOnInit() {
// println("Leap Motion Init");
}
void leapOnConnect() {
// println("Leap Motion Connect");
}
void leapOnFrame() {
// println("Leap Motion Frame");
}
void leapOnDisconnect() {
// println("Leap Motion Disconnect");
}
void leapOnExit() {
// println("Leap Motion Exit");
}

void leapMotion_draw() {

int fps = leap.getFrameRate();
for (Hand hand : leap.getHands ()) {

// ==================================================
// 2. Hand

int     handId             = hand.getId();
PVector handPosition       = hand.getPosition();
PVector handStabilized     = hand.getStabilizedPosition();
PVector handDirection      = hand.getDirection();
PVector handDynamics       = hand.getDynamics();
float   handRoll           = hand.getRoll();
float   handPitch          = hand.getPitch();
float   handYaw            = hand.getYaw();
boolean handIsLeft         = hand.isLeft();
boolean handIsRight        = hand.isRight();
float   handGrab           = hand.getGrabStrength();
float   handPinch          = hand.getPinchStrength();
float   handTime           = hand.getTimeVisible();
PVector spherePosition     = hand.getSpherePosition();

// --------------------------------------------------
// Drawing
//hand.draw();

handX = hand.getPosition().x;
handY = hand.getPosition().y;

HG = handGrab;
//println(HG);

// ==================================================
// 3. Arm

if (hand.hasArm()) {
Arm     arm              = hand.getArm();
float   armWidth         = arm.getWidth();
PVector armWristPos      = arm.getWristPosition();
PVector armElbowPos      = arm.getElbowPosition();
}

// ==================================================
// 4. Finger

Finger  fingerThumb        = hand.getThumb();
// or                        hand.getFinger("thumb");
// or                        hand.getFinger(0);

Finger  fingerIndex        = hand.getIndexFinger();
// or                        hand.getFinger("index");
// or                        hand.getFinger(1);

Finger  fingerMiddle       = hand.getMiddleFinger();
// or                        hand.getFinger("middle");
// or                        hand.getFinger(2);

Finger  fingerRing         = hand.getRingFinger();
// or                        hand.getFinger("ring");
// or                        hand.getFinger(3);

Finger  fingerPink         = hand.getPinkyFinger();
// or                        hand.getFinger("pinky");
// or                        hand.getFinger(4);

for (Finger finger : hand.getFingers()) {
// or              hand.getOutstretchedFingers();
// or              hand.getOutstretchedFingersByAngle();

int     fingerId         = finger.getId();
PVector fingerPosition   = finger.getPosition();
PVector fingerStabilized = finger.getStabilizedPosition();
PVector fingerVelocity   = finger.getVelocity();
PVector fingerDirection  = finger.getDirection();
float   fingerTime       = finger.getTimeVisible();

// ------------------------------------------------
// Drawing

// Drawing:
// finger.draw();  // Executes drawBones() and drawJoints()
strokeWeight(14);
finger.drawBones();
//finger.drawJoints();

// ------------------------------------------------
// Selection

// ================================================
// 5. Bones
// --------
// https://developer.leapmotion.com/documentation/java/devguide/Leap_Overview.html#Layer_1

Bone    boneDistal       = finger.getDistalBone();
// or                      finger.get("distal");
// or                      finger.getBone(0);

Bone    boneIntermediate = finger.getIntermediateBone();
// or                      finger.get("intermediate");
// or                      finger.getBone(1);

Bone    boneProximal     = finger.getProximalBone();
// or                      finger.get("proximal");
// or                      finger.getBone(2);

Bone    boneMetacarpal   = finger.getMetacarpalBone();
// or                      finger.get("metacarpal");
// or                      finger.getBone(3);

// ------------------------------------------------
// Touch emulation

int     touchZone        = finger.getTouchZone();
float   touchDistance    = finger.getTouchDistance();

switch(touchZone) {
case -1: // None
break;
case 0: // Hovering
// println("Hovering (#" + fingerId + "): " + touchDistance);
break;
case 1: // Touching
// println("Touching (#" + fingerId + ")");
break;
}
}

// ==================================================
// 6. Tools

for (Tool tool : hand.getTools()) {
int     toolId           = tool.getId();
PVector toolPosition     = tool.getPosition();
PVector toolStabilized   = tool.getStabilizedPosition();
PVector toolVelocity     = tool.getVelocity();
PVector toolDirection    = tool.getDirection();
float   toolTime         = tool.getTimeVisible();

// ------------------------------------------------
// Drawing:
tool.draw();

// ------------------------------------------------
// Touch emulation

int     touchZone        = tool.getTouchZone();
float   touchDistance    = tool.getTouchDistance();

switch(touchZone) {
case -1: // None
break;
case 0: // Hovering
// println("Hovering (#" + toolId + "): " + touchDistance);
break;
case 1: // Touching
// println("Touching (#" + toolId + ")");
break;
}
}
}

// ====================================================
// 7. Devices

for (Device device : leap.getDevices()) {
float deviceHorizontalViewAngle = device.getHorizontalViewAngle();
float deviceVericalViewAngle = device.getVerticalViewAngle();
float deviceRange = device.getRange();
}
}``````

# Kinetic Interfaces: Week6 Assignment–Moon(Ribirth Huang)

For this assignment, we are ask to make something interactive with leap motion. I am going to make a project that can let my hand grab the falling balls and make them fall form the top of screen again. Fist of all , I code the balls part. I float three invariable value for the […]

# Kinetic Interfaces:Week6 Assignment–Moon(Candy Bi)

Documented by: Candy Bi Project name: Lemonade Professor: Moon Date: 10/21/2018 Target：Create a simple interaction with Leap Motion or Face Tracking, including the button states (triggered, pressed and released)

# Kinetic Interface – Week 6 Leap motion (Peter)

Intro In this week’s assignment, I am practicing basic usage of Leap Motion. Idea So what I created for this assignment is basically a drawing program. It has two more functions than the one we went through in class: color changing and clearing. Specifically, other than just using your index finger to draw, you are […]

# Kinetic Interface – week 4+5: Pixels and Introduction to Computer Vision (Emerald)

For this assignment we need to program an interactive or alternated portraiture with pixel iteration or manipulation. So thinking of the bouncing ball, I decided to make a webcam which combines the bouncing feature. Also, I wanted to create a sense of meteors, so I drew squares instead of ellipse. What’s more, because they are […]

# Working With Electrons – Ferrofluid Heartbeat Kinetic Sculpture (Kevin Li)

What I really wanted to do in my kinetic sculpture was get started experimenting with ferrofluid as I started to gain a better understanding of what I want to do for my midterm and final projects. So, I used this assignment as a launching pad to get some experience with playing around with ferrofluid to […]

# Kinetic Interfaces: Assignment Week4+5 (Emma)

Here is the link to my week4 assignment: Click Here For the assignment this week, we are asked to program an interactive or alternated portraiture with Pixel Iteration or Manipulation. I think the process of calculating and expressing is very interesting. I created two experience for this assignment, one is very basic, and the second one is […]

``````PImage img;

void setup() {
size(800, 800);
background(0);
noStroke();

}

void draw() {
image(img,0,0,800,800);
int ct = 255;
textSize(50);
fill(255);
text("Press The Mouse!", 200,80);
}

void mousePressed() {
println("1");
int w = img.width;
int h = img.height;

for (int y =0; y<h; y++) {
for (int x=0; x<w; x++) {
int index = x+y*w;
color c = img.pixels[index];
float r = red(c);
//float g = green(c);
//float b = blue (c);

if (r >200) {
img.pixels[index]=color(87.0, 5.0, 139.0);
}
else {
img.pixels[index]=color(255);

}
}

}
img.updatePixels();
image(img, 0, 0, 800, 800);
}

2.
PImage img;

void setup() {
size(800, 800);
background(0);
noStroke();

}

void draw() {
image(img, 0, 0, 800, 800);

//for (int x = 0; x<img.width; x+=40) {
//  stroke(255);
//  strokeWeight(1);
//  line(x, 0, x, img.height);
//}

//for (int y=0; y<img.height; y+=40) {
//  stroke(255);
//  strokeWeight(1);
//  line(0, y, img.width, y );
//}
}

void mousePressed() {

int w = img.width;
int h = img.height;

int index = (mouseY-1)*w + mouseX;
println(index);
println(mouseX, mouseY);

color c = img.get(mouseX, mouseY);

for (int b=0; b<21; b++) {
for (int a=0; a<21; a++) {
if (red(c)<100) {
img.pixels[index+w*b+a]=color(255);
} else if (red(c)>200) {
img.pixels[index+w*b+a]=color(87, 5, 139);
}
}
}
img.updatePixels();
image(img, 0, 0, 800, 800);
}
``````