Thursday, May 9, 2013

Final Project: Physics

My partner and I decided to try and combine two programs of ours into something cool for our final project. He had wrote a web drawing program using the TUIO library and I had had started build a basic 2D physics engine. Ill skip for now on what it ended up being and later explain how we got there. This what the starting screen looks like.
We ended up basing it mainly off the physics engine and just adding the web drawing as a feature. You can turn it on and off using one of the button in the lower right hand corner. The rectangles move around in the left area and you can control certain properties of the engine using the interface on the right. You interact with the program using the TUIO library. This also allows you to grab the squares and throw them around the screen or break certain squares into four part by turning break mode on. Here are some photos of the program in action.


In the middle photo you can see the web drawing feature turned on. The lines that are draw match the color of the square that makes it. In the lower image you can see the engine can handle a lot of shapes assuming collision detection is turned off. It can still do a fair amount of shapes with collision detection turned on.

Now let me describe my portion of the project. I did essentially all the coding for the project. I had already set up the main working physics engine but I spent a lot of time refining the program and adding lots of new features such as the breaking apart and  being able to switch from 3D view to 2D view on the fly. I also did all the UI coding. I figured out how to make sliders and buttons out of existing code in my program. I just use a shape and the function to detect if a cursor is inside the shape when it is added to tell if you click on a shape. And for making a slider I just bound a shape to a line and used my code that allowed me to move shapes but I just didn't move it along the y-axis. Also the numbers in the upper left hand corner is the collision counter for program. It started out as a debugging tool but I liked it a lot and just ended up leaving it in the program. One of the coolest things about this project is that I got results that I was not expecting or trying to make happen. If you increase the elasticity and get the shapes moving at max velocity they end up forming into lines and you can get some cool looking affects. With a certain amount of particles I could get it to look like grease popping on a stove. With more I could make it look like a water show. With even more I could make it look like waves of water on a beach. Or with even more it looks like those lines on old television screens.
I really enjoyed this project. It never really felt like homework. I wanted to work on it because I enjoyed it and I wanted to see what I could get it to do next. I hope to continue the project continue to upgrade the engine to do even cooler things.

Here are all the links you will need to run the program yourself:
The TUIO library software: http://www.tuio.org/?software
I used the mac track pad software called "Tongseng" for the tracker software.

Also I would like to try and add later a web version of the program that you can manipulate by using the keyboard or maybe the mouse.

Wednesday, May 8, 2013

Art Show

We had an art show during the middle of the semester and for my contribution, I and another student worked out how to make our professor's program work with a multi-touch library in Processing. Our goal was to be able to push around the simulated fluid dynamics with multi-touch inputs using the TUIO library. This library works by getting the information over some tracking software that using the TUIO protocol. This can be for any type of hardware: wii remote, track pad, light sensor, etc. For our project we had a table that detected touches by detecting light fragmentation on a piece of acrylic glass. I did a lot of the programming for this assignment. Setting the table up for the art show was quite a task. The table basically fell apart on the way over and luckily we had a back up battery power supply for the computer. Also for the art show I entered my Visual Poetry assignment. We ended up having to buy apple VGA converters to run the programs because the Linux machines that we had were not capable of running them. I enjoyed being in charge of getting mine and two others' programs to run on one screen. It turned out pretty well in the end. I enjoyed my first art show experience.