Monday, April 30, 2012

Comp Fight

 Summary
The project that I did for my final consisted of a fight sequence between a player and their computer using the Kinect to track punches as well as blocks. What my project would do is simulate a game between them and the computer because like the player, the computer will fight back as well as block.

Technical
To make this work I had to first track the users skeleton using a Processing Patch written by Jesse Gilbert (my professor) that tracks the the body basically from head to toe (Here is what is needed to use this, there are instructions on the page for a simple install of OpenNI: Install Steps. Use this so that Processing could interact with Max OSC Download ). Once this was completed we used an OSC object to get the information that is being detected on the Kinect by the processing code.

After that I created a sub patcher that holds the information of the range like x and y as well as z which is depth. For y patcher I used primarily the Z range because that detect how close a fist is to the Kinect. After I was able to set a range that sends a bang every time a fist goes beyond 0.2 of range.

To mimic a fighting game, I set a beginning time that does not allow the player or computer to hit until after  5 second. another way to mimic a game, I was able to create a life bar that decreases every time the Kinect detects a punch. After I was able to establish how the life bar would deplete (by subtracting 10 from from the life bar when a fist is in range) I wanted to create a blocking system so that it would even further be like a game. To do this I again used the Z depth but this time to detect how further is the leg. My blocking system is detected by putting your right leg back. I saw that wen people were playing this they were blocking ad punching at the same time and I believed that that was not fair so I used a ggate object to switch from blocking to hitting so if someone tries to punch while hitting it would not be possible to do damage. After I established everything that needed to be done for the user I started on the computer.

The computer was a lot less complicated in terms of creating punches and blocks. The computers runs of a metro which is basically a digital metronome which means that it could determine how fast bangs are given out. These bangs would be sent into a random number generator that is set to 50 so that it outputs 50 random numbers from the range of 0 to 49. In order to send out a punch I used what is called the select object which is an object that only sends out a bang when the random number generator (or whatever its connected to) reaches a specific number. I did this for both punches and blocks and like the user if the computer blocks it cannot hit you.

Once I had the fight system going, I created visuals so that the patch isn't plain. These visuals consisted of street fighter gifs that were turned into mov's (so that Max could read it). Each action had a corresponding video. For instance, a right punch would trigger a right punch video and so on. A problem with this is that I had to use a Rate atter UI to make the video play faster the reason that I did this is because people would punch so fast that the action on the video would not play all the way through. same thing goes for the computer which is still something I was not able to fix.

Something that i wanted to do with this patch was make it realistic and to do that I wanted the video to go back to a regular stance when either the computer or the player or doing nothing. which means that after a punch or a block the video would go back to its a original stance. To do this the toggle button was used. the toggle button has to numbers in it 0 (off) and 1 (on) using these 2 numbers I switched between an action and a stance pretty easily.After all the videos were fixed I recreated an end game that would not only stop the game but also play an  end game mov. since the life bar has numbers for a range I used a select object for when the slider reaches 0. when the slider reaches 0 the patch stops by closing (setting to 0) all ggates and toggles but playing a video on both sides that is triggered only when the slider reaches 0. along with this a message with a 1 in it is sent to the Rate atter UI so that the end game is played at normal speed.

Inspiration
I was inspired by this Street Fighter Kinect Hack because this person was able to do everything that I was trying to do but he used something else. He was able to fight with his body and create super moves and i wanted to do that to but i do not believe that I would be able to do that at least not yet. But thanks to this I was able to get the ball rolling into creating my patch. Which I called Comp Fight, Enjoy.

Future
For the future I want this patch to be able to support imported 3D characters like from Maya. I would like to see people use my patch to import there characters that they created and play using my patch and also i would want to make this a 2 player game. To do this I would have to find the range of the arm and legs using the model itself and the person themselves as well as create a completely separate patch for the second player which i do not know how to do yet. This was originally the idea for my project but proved to be too problematic due to changing conditions of the patch but ultimately this is my goal and I would wish to see it through.

Monday, March 26, 2012

Kinect Control

http://kinect.dashhacks.com/kinect-hacks/2011/01/19/street-fighter-iv-kinect-hack-plus-faast-key-bindings

This video has what I basically want to do for my project to be able to control characters movements and use specific movements for characters all of this done on a 2d platform

Wednesday, March 21, 2012

Kinect Proposal

The Idea I have for my final is to create some sort of interactive gameplay using max and the Kinect camera. The idea that I have for this is to use a created character brought from a Maya model to be used as a playable character on the Kinect interface. Using the rig that is place on the Maya character I would mimic it to the kinect using skeleton tracing to allow the rig and the skeleton to become one allowing the player to move the character with there own body. Once this is done I have the idea to allow the players to fight each other using the characters brought in by Maya. The perspective during the fight will vary as I have the idea to allow for a shifting camera. Along with the fighting aspect I want create a majority of games which will be created if time allows it. For Instance, I want to be able to create multiple games not just the fighting one which will all be on the same patch. The way they are selected is by having a player hover there hand over the desired option.

Wednesday, February 1, 2012

Midterm Paper Pitch: The Wonder of the Electric Guitar

For my mid term paper I wish to write about the Electric Guitar. What makes me want to write about this wondrous instrument is because I myself am a musician more specifically a guitarist. The thing is that I only played the guitar I never bothered to care what is the story, the movement, or the inspiration behind the guitar. It is not just noise it is a voice for the voiceless, it is what makes life tolerable (in my opinion). The guitar has a large history with many stories and I want to explore them.

Wednesday, January 11, 2012

What Technology Is To Me

Technology is a very complicated word to define and for me it’s even harder to understand but besides this fact pin pointing the reason why I am interested in the technology is hard. Technology in my definition is a tool society uses that simplifies and benefits life; this simple tool does necessarily have to work with electronics but it could actually be anything like a soda can that has been hollowed out to become a trash can, the possibilities for technology are endless.

Based off of this definition I got interested into technology, the thought of society using a tool that I created to benefit their lives to make their lives easier and worry free. See making the world more manageable and livable is a dream I have. Seeing people obtain joy from the use of my products I created is something that keeps me going but yet that is still a dream not and not a reality. With the second part of the definition I feel I can create a reality.

Technology never ends and something new will always come out that would be better than previous inventions and that’s where I can prosper because I can create. My dream is to create; I love creating people, places, etc. and with technologies advances I will be able to create. In games, people like to create characters based off of themselves' or who’d they like to be. If people create using my games or technology I created and have joy from it then I know that I benefited in making someone’s life pleasant in some form.

Thursday, November 10, 2011

How My Computer Percieves Me


I got a feeling that my computer sees me as a monster with their eyes popping out glued to the computer argh so horrific

Thursday, November 3, 2011

Integer Version Robot

Here is the Integer version I'm posting this because I was finally able to do it but I could only go this far and also because it is not saving properly so out of fear of it being erased I'm posting what I got so far

int x = 60; //x-coordinate
int y = 420; // y-coordinate
int bodyHeight = 120; //bodyheight
int neckHeight = 100; //neckheight/Antennae
int radius = 10; //head
int ny = y - bodyHeight - neckHeight - radius; //Antennae

size (720, 480);
smooth ();
strokeWeight (2);
background (204);
ellipseMode (RADIUS);

//Head
stroke(102);
fill(102);
ellipse(x+190, ny-90, radius, radius); //ball
line(x+200, ny+10, x+190, ny-90); //Antennae
ellipse(x+175, ny+25, radius+5, radius+5); //left ear
ellipse(x+233, ny+25, radius+5, radius+5); //right ear
stroke(0);
fill(0);
ellipse(x+204, ny+59, radius+45, radius+45); //head
fill(255);
ellipse(x+220, ny+45, radius+6, radius+22); //right eye
fill(255);
ellipse(x+185, ny+45, radius+6, radius+22); //left eye
fill(0);
ellipse(x+228, ny+45, radius-7, radius); //pupil
ellipse(x+177, ny+45, radius-7, radius); //pupil


//Body
noStroke();
fill(102);
ellipse(x+204, y-50, radius+35, radius+35); //end orb
fill(0);
rect(x+159, y-bodyHeight-43, bodyHeight-30, bodyHeight); //main body
fill(102);
rect(x+168, y-bodyHeight-26, bodyHeight-50, bodyHeight-70); //inside panel
rect(x+159, y-bodyHeight+50, bodyHeight-30, bodyHeight-114); //gray stripe

Wednesday, October 19, 2011

Upgrade Arduino Vintage Radio

This is my new and improved Arduino project.
Using Plexiglass and a laser cutter. I was able to create a great design for this project making that whole vintage radio type look.
I exposed the wires to make it seem robotic.
Also to make sure i didn't mess up cutting the plexiglass i practiced on cardboard.
Once i saw that everything was perfect I spray painted the front and back black and the center pieces red to give it a dark type mood.
The radio is powered by
the Arduino and it actually works like a radio it is powered on by the button and the dial changes the song three times.

Here is my Patch and Presentation

In total all I payed for this project was around $12 since all I needed was already in the Arduino so all I had to pay for was the Plexiglass.

Wednesday, October 5, 2011

Arduino Music Machine





Here is my Music Machine so far. Using cut pieces of cardboard and then taping them together and spray painting them lime green then black I was able to create a vintage looking radio.

The radio is powered by the arduino board that will eventually be able to play a song by pressing the button and changing the song by turning the dial.

Thursday, September 29, 2011

Arduino LED Blinking Light



This is the blinking LED light. To do this project it requires an arduino kit (obviously)and also putting a light pin on 13, under GDN, with the small tip first the. First connect the Arduino board to the computer using the USB cord and then you open up Arduino on the computer and type the code:

void setup() {
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH);
delay(500);
digitalWrite(13, LOW);
delay(300);
}
This code determines how fast you want the LED light to blink and the delay on it.

Thursday, September 22, 2011

My Robot





//Robot
size (720, 480);
smooth ();
strokeWeight (2);
background (204);
ellipseMode (RADIUS);

//Head
stroke(102);
fill(102);
ellipse(250, 100, 10, 10); //ball
line(260, 200, 250, 100); //Antennae
ellipse(235, 215, 15, 15); //left ear
ellipse(293, 215, 15, 15); //right ear
stroke(0);
fill(0);
ellipse(264, 249, 55, 55); //head
fill(255);
ellipse(280, 235, 16, 32); //right eye
fill(255);
ellipse(245, 235, 16, 32); //left eye
fill(0);
ellipse(288, 235, 3, 10); //pupil
ellipse(237, 235, 3, 10); //pupil


//Body
noStroke();
fill(102);
ellipse(264, 370, 45, 45); //end orb
fill(0);
rect(219, 257, 90, 120); //main body
fill(102);
rect(228, 274, 70, 50); //inside panel
rect(219, 350, 90, 6); //gray stripe

Sunday, September 18, 2011

Make 5 Projects

1-Batteries from Everyday Things: This project is very convenient when low on battery life. This project allows one to create a battery out of every day objects using a catalyst like material like zinc.

http://makeprojects.com/Project/Batteries-from-Everyday-Things/1347/1

2-Army Guy Bowl: This is a pretty fun project when you have a lot of soldier toys and a lot of time. It is a fruit bowl made of toy soldiers and it is made by using a heat gun and a bowl to get the shape and in the end it looks really cool

http://makeprojects.com/Project/Army-Guy-Bowl/1338/1

3-Kitty Kaleidoscope: This is a fun project but one needs to be tech savy.this person us3ed photoshop to create a kaleidoscope effect of a picture of their cat.
http://makeprojects.com/Project/Kitty-Kaleidoscope/1293/1

4-Paper Pocket Loom: This is a pretty interesting project for those who like sowing. This project is what I believe an antique sowing machine and it is made out of paper and yarn and if done correctly it can make a scarf.

http://makeprojects.com/Project/Paper-Pocket-Loom/1275/1

5-Swing Shift Ruffles: This project is for women that like their dress so much but don't want to seem as if they where the same thing over and over. This dress can change into different types of disguises.

http://makeprojects.com/Project/Swing-Shift-Ruffles/1307/1

Thursday, September 15, 2011

Life To Broken Techonology


This is my discarded piece of technology. It is an aluminum can that is found in Woody's. This is usually used as a container for liquid but I decided to drink it and turn it to something else.


Being an innovator....yeah not really... I decided to take a pair of scissors and an X-acto blade and cut out a hole on the lid to be able to put stuff in. After struggling like hell to make the hole big enough, I put a bag through it so now what was once considered trash can now collect it. So you could do this or make it into another storage device.

Wednesday, September 7, 2011

Dream Machine





This is my dream machine named Dr. Diagnosis, this machine is capable of diagnosing any sickness and also allows one to figure out a way of how to treat it. All of this is done by depositing $10 and also by supplying the machine with a urine sample that is poured into the machine.
This Dream machine that was thought up for class was inspired by a joke and this is that joke. Enjoy.

Sunday, April 4, 2010

FR 5

A)R(t)=rate of which sand is removed. The is how much is being removed. so take the integral. So to see how much the tide take away the first 6 hrs set the integral from 0-6 making the equation:
fnInt(2+5sin(4nt/25),T,0,6) = 31.81593137 simplified it is 31.816 cubic yards

B)To fond the amount of sand at a certain time you must subtract S(t)-R(t)since there is no exact time but a starting point the integral will be from 0-x. At t=0 there is already 2500 sand so it must be added so the equation is:
Y(t)=2500+fnInt (S(t)-R(t), t, 0, x)

C)Y(t)=total number of cubic yards of sand on the beach. Y'(t)=rate at which the total number of sand is changing. so the derivative is Y'(t) is just S(t)-R(t). now we just have to find it at t=4 giving the equation Y'(4) = 15(4)/1+3(4) - 2 + 5sin(4(4)π/25). After the simplifying it equals Y'(4) ≈ -1.909 cubic yards/hour.

D)To find the minimum amount at the equation at part A don't you graph it and find the intersection. If so then the intersection is at (5.1178, 4.6943)so at 5.1178 it equals 4.6943 + 2500=2504.6943 cubic yards.

DONE???

Saturday, March 6, 2010

MEANIE

The mean value theorum means: F'(c) is the derivative at x=c and the slope of the secant line through the interval [a,b] is F(b)-F(a)/b-a all this basically means this Point of Secant line is equal to the Point of the Tangent line.
For Instance my graph would be x²


lets say the intervals are from [o,3] so then a=0 and b=3 now we got the points now all we need is to use them in the equation and find c so F(3)-F(0)/3-0 =3 so the slope of the secant line is 3 and the equation is the derivative 2x



Ok so skipping all of the equations blah blah blah we find that c lies on x=1 and knowing that we can do the tangent line. Which again blah blah blah we find that it passes through (1,1)and since the tangent line is parallel to the secant use that knowledge and pont slope form and then we get the equation F(x)=2x-1 and bam definition graphically



2. this doesnt work for equations that end up being cusps, corners, etc like and absolute value equation it is not diferrentible at x=0 so there is no tangent point there right? hehehe

Saturday, February 13, 2010

F(x) to F'(x)

1) It increases at (-2,0)U(0,2) because durint those intervals it only output positive numbers basically f'(x)>0. It decreases at (-00, -2)U(2, 00) because f'(x)<0

2)at (0, 0) Right? Because an extrema is when F'(x) is zero or undefined

3)Concave up:(-00,-1.5)U(1.5, 00)
Concave down: (-1.5, 1.5)
concave up wher the slope is positive and concave down wher it is negative

4)it is probably x^5 cause it changes direction a couple of times also because the f'(x) looks like x^4.

Thursday, January 14, 2010

Mind Boggling

  1. I am a growth mindset I always like to learn new things. i belive that anybody can improve themselves.
  2. It helped me because it allowed me to stick to math because I love challenges.
  3. Makes me want to exercise the hell out of it i could make better than ever before. Funny because even though I am not in shape my brain could be.
  4. It allows me to know that I can push myself a lot further than I know.

Sunday, December 20, 2009

Algebra VS Calculus the BIG fight

1) Finding the limit at x=c of a function is actually finding the value as x approaches the constant (c) which turns out to be the y value. Now f(c) is looking for the output when x is c I think that's what I'm trying to say. The output doesn't have to be the same as the limit of x=c but if the limit at x=c is the same as f(c) then the function is continuous and it is only continuous when it is like this. Right?...

2) Both the slope and derivative use the change in y/ the change in x formula but for the slope their is no lim unlike the derivitive where the lim is when h->0 so the difference in the equation would be lim h->0 f(2+h)-f(2)/h where h is how many point away from the initial point. Also a slope would the slope (obviously) of a specific line where a derivative would be involved with Tangent lines of curves.

This is what I got probably very arguable but eh screw it I tried...

Monday, December 7, 2009

What's my limit?

1) I always try to avoid any problem involving Sin(x)/x I do not know what exactly to do I get confused to where am I supossed to plug in the limit especially when it is zero

2) The other types of problems that I have trouble with are the problems with fractions in fractions. For instance, [(1/x+1)+(1/2x)]/x these types of problems get me stumble because I forget how to simplify the problem. Then the same thing about plugging in the limit especially when it is zero...damn zeroes.

3) Int type problems just stumble me. I know how they look but I can't graph them without using the calculator and I really do not know how to find the limit at all I try but fail HELP!!!