Final project

The name of my final project is the Space Well. I collaborate with Cass Yao from the other class.  We tried to create an experience of floating in space.

Process

The code was definitely the most difficult of this project. We spent a lot of time figuring the Simple NI library since it doesn’t have good documentation. We spent hours to create the visual effects and testing it in the water pool. The also spent hours to debug. Luckily, it worked in the show. Many people love our work.

Inspiration

When we walked in Washington square park, it was rainy. We saw a small water pool on the road. We wondered how it would look like if the stars and ourselves are reflecting in it.

1
1
1
1

videos

this is the live stream by denial Shiffman. My project is at 1:32:04.

 

Code

We used processing to make this project because we think java is faster than JS.

Because the code is too long, I will just post the controller of our code.

import SimpleOpenNI.*;
import processing.serial.*;
import codeanticode.syphon.*;

PGraphics canvas;
SyphonServer server;
SimpleOpenNI context;

int backgroundColor=0;

//rotate
float rotX = radians(180);
float rotY = radians(0);
boolean Armup = false;
boolean noArmup = false;

//thresh
float minThresh=0;
float maxThresh=2413;
float leftThresh=-750;
float rightThresh=750;

float bomb;
float bright;

PVector [] prepos;
int [] predepthMap;

boolean reduce = false;
boolean invert=false;
int waitForInvert=0;
boolean preInvert;
boolean shake = false;
boolean beginSpin = false;
boolean beginUpdatee = false;

float count = 40;

void setup() {
size(1080, 1080, P3D);

canvas = createGraphics(1080, 1080, P3D);
server = new SyphonServer(this, “Processing Syphon”);

context = new SimpleOpenNI(this);

if (context.isInit() == false)
{
println(“Can’t init SimpleOpenNI, maybe the camera is not connected!”);
exit();
return;
}
context.setMirror(false);
context.enableDepth();
context.enableUser();
context.alternativeViewPointDepthToImage();
context.setDepthColorSyncEnabled(true);

smooth();
stroke(255);
strokeWeight(5);

// Init all stars
for (int i = 0; i < starsD.length; i++) {
starsD[i] = new StarD();
}
}

void draw() {
if(countPointCount==200){
restart();
}

//println(waitForInvert);

// canvas.beginDraw();
canvas.beginDraw();
canvas.clear();
canvas.background(backgroundColor);

// explosion();

context.update();

//meteor();
userList = context.getUsers();

//maxThresh=map(mouseX, 0, 1080, 0, 3000);

//println(maxThresh);
//minThresh=map(mouseY, 0, 1080, 0, 2000);

if (userList.length > 0) {
userId = userList[0];
if ( context.isTrackingSkeleton(userId)) {
ArmsAngle(userId);
// MassUser(userId);
}
}

//star——————————————–
canvas.pushMatrix();
canvas.translate(width/2, height/2);
for (int i = 0; i < starsD.length; i++) {
starsD[i].update();
starsD[i].show();
}
canvas.popMatrix();
// speed+=0.001;

pointcloud(canvas);

//lastPosition();

//prepos = context.depthMapRealWorld();
//predepthMap = context.depthMap();

//rotY+=0.01;

if (beginSpin){
count –;
canvas.fill(255);
canvas.ellipse(width/2,height/2,1080- count*20, 1080- count*20);
if (count == 0){
beginSpin = false;
count = 40;
}
}

if (shake){

}

if (beginUpdatee){
updatee();
}

canvas.endDraw();
image(canvas, 0, 0);
server.sendImage(canvas);
}

Leave a Reply