Jumanah – Sprint 8

During this sprint I worked on having the wind put out the fire and introducing an obstacle for running out of fire wood… which would effectively also put out the fire.

 

The first thing I did was create an outWood bool variable, which would control if we draw the wood on the screen.

if (outWood == false) {
fireplaceWood.draw(400, 670, 200, 79);

}


 

The second thing I did was add it as an obstacle type. It is incomplete as Luk needs to perform a user interaction and wood will need to drop for the outWood variable to be set back to False. Right now this is just a placeholder.
else if (obstacleType == 4) { //Running out wood

if (timer < obstacleTimer) {

obstacleB = true;
outWood = true; //we wont draw the wood
cout << “Please

restock your wood” << outWood ;

}
else if (timer == obstacleTimer) {

//time for a new obstacle
outWood = false;  //this will draw the wood again, but

realistically.. the user should perform an interaction to replace the wood.
obstacleB = false;

}

}

The last thing I worked on was not adding fire particles when wind or out of wood condition exists.
if (w == 0) { //sprint 8 if no wind and theres rain ūüėČ
fire.addParticles(7 * (1 – r), X*(1 – r),

Y*(1 – r), lifeOffset*(1 – r), PARTICLE_STATE_FIRE); //add new particles

if (fire.returnSize

(PARTICLE_STATE_FIRE) < 0) {

fire.addParticles(7 * (1), X*(1), Y*(1), lifeOffset*(1),

PARTICLE_STATE_FIRE);
}
}
else if (w > 1) { // if wind exists..
//dont add fire

particles

}

3 files modified

ParticleSystem.cpp
ofApp.h
ofApp.cpp

 

For next sprint our plans are to refine animations within the environment and work only on user interactions with Kinect, now that our environment and obstacles are up and running. Spare wood will also be needed to be added to the scene when the firewoods health goes down.

 

 

 

Advertisements

Luk-Sprint 6

This sprint we focused on taking Kinect skeleton points and applying to the 2D puppet, along with fix animation and element interaction.
This Kinect driven puppet was done by taking joint position and getting 2D angle between each point, and applying the puppet. I found one problem when it came to certain angle not being transferred properly.

float tracker::getAngle(ofVec2f a, ofVec2f b, float startAngle) {
float ang = PI/2 + atan((a.y - b.y) / (a.x - b.x));
if (b.x > a.x)
ang -= PI;
return ofRadToDeg(ang)+ startAngle;//returns angle between to joint points in degrees
}

Work around this was to have offset angle,that can over correct the initial. I want to looking into a better way to fix this and get more accurate angles.

Sprint 6 – Lena

During sprint 6 I was working on the bear animation. The bear will be coming out to join the campfire when the fire is burning consistently(this might still change). Using after effects I animated the bear and exported as 120 png images which later on brought into code.

The difficulty that  am having is that the code only loads 24 frames instead of 120, therefore animation looks incomplete.

Next sprint I would have to complete the sequence animation and add horizontal movement so it looks like the bear is moving from point a to point b. Also, next week our team will be merging all of our files and cleaning the code for the presentation on Friday.

Jumanah – Sprint 6

During this Sprint, one of the important things I worked on was adding a wind effect to the code. Since we already had similar code for rain and fire, it was much of the same. I created wind particles that move with an X gravity, and also gave the fire the same X and Y gravity, so that they move in the same direction. Then I added particle images instead of drawing ellipses, this was done with the use of pointers. The wind effect is seen by a few leaves blowing in the wind. I also added a rotation to the leaves and a random offset to make things look natural.

Picture:

Screen Shot 2017-03-08 at 11.33.14 AM.png

 

I really enjoyed this sprint because I also worked on refining the rain and obstacle generation code which was all hard coded up until this point. We added a rain image instead of an ellipse, so it all looks more visually appealing. One thing that did not work out well was the Fire particle image because of the way the colors change, so we are most likely going to keep our original fire with just ellipses.

Lastly, the toughest part was how we should make obstacles random, and not follow a predictable storyline so the user does not get bored.. so I created an obstacle generator function that would randomly assign an obstacle type..

obstacleType; //

    /*

 0 РRest (Nothing)

     1 РRain

     2 РWind

     3 РBear

     */

     obstacleB; //boolean if obstacle is happening

    obstacleTimer; //duration of frames

    /*

     This will be random, the duration of the obstacle. After the duration is over, reset the obstacleType randomly

     */

Since we have a timer in the code from start, I just call the function whenever another obstacle has just ended, to assign a new obstacle, and it can literally go on forever! The great thing is that when the obstacle is 0, the user can rest.

void ofApp::setObstacle(){

    obstacleType = ofRandom(0,3); // 0 is nothing, 1 is rain, 2 is wind

    obstacleStart = timer;

    obstacleTimer = timer + ofRandom(300,600);

}

Screen Shot 2017-03-08 at 2.35.28 PM

The result is very nice, because now we don’t know what to expect every time the code runs!

I am very happy with this sprint! Ran into very little problems!

Next up is combining the code once again and having the user interact with the obstacles.

Jumanah

Luk-Sprint 5

Covered this sprint I added a body puppet and tracking class, using the Kinect body tracking information. There is issues with tracking position and the scaling of the different joints/bones. I learnt better way to keep track of user interaction, moving to it’s own class that can trac We decide on you using the body puppet to represent the users, for two main reason, one the art style would be consistent and secondly the movement can be captured and relayed back with loss of information. This would push for a stronger immersion and seem less interaction.

Sprint 5 – Lena

image.png

This week I was working the puppet design for the kinect skeleton. To stay assistant with the theme we decided to go with the camping theme and I created two versions of Bigfoot silhouettes. The fist one is cartoon like and the second one is more realistic. During the sprint meeting on Friday, team will decide which puppet will look the best with the environment. I have also designed images used for the particles Рrain, fire, and wind.

I have worked on the xCode from the last sprint that Jumanah provided me with because our group is is still in the progress of adding and changing libraries.

Also,  I have perfected day-night transition animation. Before, transition only changed through a 255 frame period, now that period can be any number. Also, before it was day-night transition which I changed into day-sunset-night transition.

if (timer < NIGHT+MORNING_PART_1){

        imgAlpha = 255-(timerNIGHT)*256/MORNING_PART_1;

    }

    //transition from sunset to day

    else if (timer < NIGHT+MORNING_PART_1+MORNING_PART_2){

        imgAlpha = 0;

        imgAlpha2 = 255-(timer-(NIGHT+MORNING_PART_1))*256/MORNING_PART_2;

    }

In addition I worked on the foreground animation. Last sprint I was having trouble animating branches because I was loading all branches as a sequence of images this way wold have  not worked if we decided to implement user interaction later on. Therefore, for this sprint I have decided to take a different approach and individually load each branch to the scene and animate it using code.

Next sprint we will be adding custom images to particles and finishing most of the particles such as fireflies and wind. Start mapping the Bigfoot to the skeleton of the participant and we will start on the interaction between the user and the environment.

 

Sprint 5 – Jumanah’s Blog Post

The focus of this sprint was enhancing the wind and rain effects.

Since Luk is working on changing libraries with Kinect, we have decided to postpone combining code, so this is once again a separate xCode project.

During this sprint I worked on having the rain particles interact with the fire and put out the fire eventually. I was able to get this working finally, after setting a rate at which rain particles are attacking the fire per 100 frames, and eventually this will result in a value that will stop drawing fire particles. So every 0 to 100 frames I will check the number of rain particles near the fire, and return a rate.

Then I multiple this rate r by the amount of particles i am adding to the  fire scene per update.  Eventually the rate becomes too strong and the fire has no fire particles. I bring it back to life.

   fire.addParticles(7*(1-r), X*(1-r), Y*(1-r), lifeOffset*(1-r), PARTICLE_STATE_FIRE); //add new particles

    

    if (fire.returnSize(PARTICLE_STATE_FIRE) < 0){

        

        fire.addParticles(7*(1), X*(1), Y*(1), lifeOffset*(1), PARTICLE_STATE_FIRE);

    }

 

I also worked on wind, giving a positive X direction gravity

  //WIND EFFECT

    else if (timer > 300 && timer <= 600){

        

¬† ¬† ¬† ¬† fire.setGravity( ofVec2f( 0.03, –0.07 ) );

        windTimer++;

    }

   This sprint was much more successful than the last sprint because the fire actually changes now depending on the surrounding environment. Whats left is to have the user protect the fire somehow.

The next sprint we will work on user interactions that will prevent the fire from being put out and puppet mapping.

Jumanah