Tuesday, September 24, 2019

Proessing Assignment 1


For this assignment, we had some practice with a coding program called Processing. It definitely felt like working in another language (I guess it is!). I ended up doing a pretty simple program in which a user can control whether there was a blank canvas or one of 2 shapes and backgrounds depending on if there was C, R or no key pressed

My code, click to enlarge


 

Some code that I had a hard time understanding is else. I suppose it didn't work here because it was unnecessary for it to work in order to have the 3 different screen states but I tried to implement it in lieu of the second if statement.
Another set of code that I wanted to use in the original program is the constrain feature, as I did not want the ellipse to grow past the canvas. There is only one example of constrain in the 7th chapter reading but I could not understand how to adapt it to my needs.

Otherwise, a simple but fun project that proves that I need more practice at coding.

Wednesday, September 18, 2019

Rube Goldberg project in Unity with only 3D objects

This is my first time using Unity and it was an interesting experience! In this assignment, we had to use 3D objects to create a Rube Goldberg like event. At first, I wanted to create a swinging cup that held the starting ball, but I had major issues trying to get the hinge to work and even though I created an empty object in which to place the swing the objects inside did not act as one whole unit. As you can see from this blooper video.



So I scrapped that idea for the finished project!

For the final version, I used a sphere with a mass set to 3 that dropped down from the sky, which landed and rolled onto 2 ramps which I added a physics material of friction dynamic of .1 to really get the ball rolling ;)  The subsequent platforms did not have this physics material added. That sphere would then collide with a grouping of cube shapes set into a row that would start the domino effect. With these cubes, I also increased the mass to 3 so when the final domino fell onto the next seesaw stage it would create a nice lift in the flying object. 

The seesaw was created using a cylinder that I place with all the axis points frozen. For the long cube that I used as the seesaw itself, I froze it on the X-axis and gave it a mass of .75.  For the pink cube that would be flung I altered both the mass and the angular drag to .05 as I wanted to see it get some nice height once triggered. 

Originally I wanted to use 2 more cylinders one as the object that would be flung from the seesaw and as the final end platform. When I created the 2 objects as flat coin-like shapes I would see them collide together as if they were spherical objects with the sphere existing where the rotate tool area showed. So for both objects, I opted to use more cubes. With pink cube and the final platform, I created a friction physics material so they would collide together and the pink cube would immediately stop in place. For a bit of fun, I added a metallic asset with checkmarks to the final platform.

All 3D objects have ridgebodies attached except for the platform because when I originally did add them I found that when the scene was played the objects would all sink into each other.