Lena – Final Blogpost (Sprint 10)

By the end of the sprint I have finished the interaction between the user and a branch, if the puppet touches the branch it would start moving up and down for some time. Also, our team was working on cleaning the code and creating a better user experience.

During this semester I created most of the assets, also I worked on the bear animation, branch animation and interaction, and day and night transition.

I have learned a lot and greatly improved my programing skills during this semester.

Jumanah – Final Blog

After a semester of working on this project, we are just about ready to showcase our work. This sprint was spent merging code and adding final touches – polishing our work for our final presentation.

Overall, I was in charge mostly of creating the storyline and particle systems for the fire, rain and wind. I worked on adding random obstacles such as rain, bear attack and wind storm. During the last part of this project I got to work with Kinect, when creating an interaction to scare the bear away.

During this semester I learned how to use xCode, Git, OpenFrameworks and Kinect. I also learned a lot about creative coding.

I am very excited to show what we accomplished! It was fantastic working with Lukundu and Lena!

Jumanah

 

Sprint 9- retrospective-Lukundu

Nearing the end of the build, we’re adding and combining all the visual elements. I worked on refining the user interaction and updating the fire particle effect.

The user interaction as discussed in the last sprint was based on point line distance. I found a better way to get more accurate distance across all the tracked joints.


float ofApp::getDist(ofVec2f a, ofVec2f b, ofVec2f rv) {

//ofVec2f line = b - a;
//ofVec2f lp = a - rv;
//ofVec2f c = line * line.dot(lp) / line.dot(line);
//ofVec2f d = lp - c;

//return d.dot(d);

ofVec2f ab = a - b;
float line = ab.lengthSquared();
float t = ofClamp((rv-a).dot((b-a))/line,0,1);
ofVec2f dp = a + t* (b - a);

return rv.distance(dp);

}

One problem I ran into was that calculation needed to be inside the kinect track class. Otherwise, the user reference overwrites the tracking point for the second user.

Referencing The Nature of code, by Daniel Shiffman I added perlin nosie to the fire, to give the look of embers flying off as the fire dies.

float time = ofGetElapsedTimef();
float x = ofRandom(-1,1)*position.x*ofNoise(time-50);
float y = ofRandom(-1,1)*position.y*ofNoise(time+80);
x *= 0.001;
y *= 0.001;
ofTranslate(position.x, position.y);
applyForce(ofVec2f(x, y));


In the final sprints, I’ll be refining more of the code and polishing off the interaction, we’ll hold user testing over the week to better adapt the installation.

Sprint 9 – Lena

During this sprint I resized dimensions of the screen and moved branches and the awl to the new positions. Also, I created multiple clouds that would be animated before the rain starts, indicating weather change. cloud2 Also, I got to work with Kinect to create interaction between the user and a branch. The idea is to rotate the branch back and forth multiple times when the user makes contact with it. Current problem is that the branch is an image, therefore the user might touch part of the image but not the branch itself.

Plan for next sprint is to just work on existing interactions and polish everything up so the installation would be ready for the final presentation.

if (distB < 20) {
if (rv.x <= users2.a_l_armln.x && rv.x >= users2.b_l_armln.x) {//left arm

//Branches
if (branchDir == UP) {
branchAngle = branchAngle + 0.3;
if (branchAngle >= 10) {
branchDir = DOWN;
}
}
if (branchDir == DOWN) {
branchAngle = branchAngle – 0.3;
if (branchAngle <= -10) {
branchDir = UP;
}
}

Sprint 9 – Jumanah

During this sprint I finally got to work with Kinect, as we only had one device amongst our group members, so I worked on creating the user interaction with the bear.  I faced some difficulties trying to understand the Kinect code as I did not work with much previously, as we were working separately.

The best way to implement the bear interaction was for the user to raise and spread their arms, to scare the bear out of the scene. I used the joints to get the angle between the left and right arm and store it in a bearAngle variable:

bearAngle = getAngle(rShoulder.getScreenPosition(), lShoulder.getScreenPosition(), 0);

If the angle is great then the bear would exit the scene from the left and a new obstacle will be set.

As we are reaching the end of this project, we will spend the upcoming weeks polishing the interactions, puppet and particle systems. The interaction we may have to drop is the user wood interaction due to time constraints.

 

Sample code:

if (users.returnRoar()) {
            bearPosition -= 5;
            cout << "BEAR POS" << bearPosition << "\n";
        }
        else if (users.returnRoar() == false) {
            bearPosition++;
        }

Sprint 8 – Lukundu

This sprint I focused on correct size issue with the character, and joint rotation.
The resizing is related to how much space characters takes up relative to screen, allowing for users to experience more of environment. The joint rotation lock problem comes the rotation hierarchy, the child joint rotation canceling out the next rotation, to fix this apply the negative angle from the joint above before applying new rotation.

ofPushMatrix();
ofRotate(0, 0, 0, 1);
ofTranslate(reScale(cHip.getScreenPosition()));
body_IMG.setAnchorPoint(body_IMG.getWidth() /4, body_IMG.getHeight() / 4);

//left arm
ofPushMatrix();
l_arm_IMG.setAnchorPoint(l_arm_IMG.getWidth()/4, 5);
ofTranslate(-42.5, 15);
ofRotate(getAngle(lShoulder.getScreenPosition(), lElbow.getScreenPosition(),0), 0, 0, 1);
l_arm_IMG.draw(0,0,0, l_arm_IMG.getWidth()/2, l_arm_IMG.getHeight()/2);
l_arm_IMG.update();

//Left forearm
ofPushMatrix();
ofTranslate(0, l_arm_IMG.getHeight()/2 - 5);
ofRotate(-getAngle(lShoulder.getScreenPosition(), lElbow.getScreenPosition(), 0), 0, 0, 1);
ofRotate(getAngle(lElbow.getScreenPosition(), lWrist.getScreenPosition(),0), 0, 0, 1);
forearm_IMG.setAnchorPoint(forearm_IMG.getWidth() / 4, 0);
forearm_IMG.draw(0, 0, forearm_IMG.getWidth()/2, forearm_IMG.getHeight()/2);
forearm_IMG.update();

//Left hand
ofPushMatrix();
l_hand_IMG.setAnchorPoint(l_hand_IMG.getWidth() /4, 5);
ofTranslate(0, forearm_IMG.getHeight()/2 - 2.5);
l_hand_IMG.draw(0, 0, l_hand_IMG.getWidth()/2, l_hand_IMG.getHeight()/2);
forearm_IMG.update();
ofPopMatrix();//hand
ofPopMatrix();//forearm
ofPopMatrix();//shoulder

The biggest problem was presented by the way the character isn’t moved by change position but driven by on angle between Kinect joints parented to the body. The collision requires the joint positions in order to calculate the interaction of point to line. I’ll have to redesign the way the body is driven or possible look into make the body segments into box2D elements.

Lena – Sprint 8

This sprint I finished the bear animation and brought it into the code. Last sprint I had trouble loading my image sequence that I animated in After Effects, this week I fixed the problem and created a successful animation. Also, fixed the owl code as it stopped working after adding the day-night transition last sprint. Furthermore, in order to make transition from Xcode to Visual Studio I worked on combining Jumanah’s code with mine because we have been working on two separate projects.

In addition, I fixed the Bigfoot images because images looked broken where legs and arms bend, in order to fix it I rounded edges of joining parts.  bigF.png

Also, I found and downloaded audio for day, night, bear, rain, and wind, which I later trimmed as the original audio was very long.

Next sprint our team is planning on working on interactions, the problem we might face is the lack of Kinect. We only have one Kinect and that could be a problem because at this stage each member has to constantly check their code.