Learning Processing Reflection

After reading chapter 10 and 11, it reiterated that I should continue some habits and that I need to improve on others. While working on the midterm, like the book said, I primarily worked on the project by breaking it up into parts. I would work on making one object at a time and making sure one worked before I tried to implement another. I also did what the book recommended; I often created new classes in separate sketches so that when I knew it was working, I would add it to the compiled sketch. I think the debugging chapter was the most helpful to me because while making my midterm sketch, it was really easy to get frustrated. Going forward, I will take more breaks from my sketch and talk through it with someone. I think since we know our code so well, problems or errors don’t stand out to us. Something the book doesn’t talk about is not breaking it down into parts, but what tools to use to make something. While working on my sketch, I wanted to make or do things, but I had no clue where to begin. It wasn’t a problem of having too many things or being overwhelmed, it was a problem of not knowing what to do whatsoever.

 

Midterm Project

Hello everyone,

As promised, I have finally fixed the bug for my project and was able to get all the code to compile and give me my desired result. For my project, I wanted to create a 3d version of the solar system Ahmed and I made for the second project of the class.

I first want to begin that by saying that I had to recode the project in order to make it work. It does not seem to be working for open processing but it runs just fine on my laptop. I will be attaching a video of the actual project.

I started the project by making an object of a planet, sun or moon.  Since they are all spheres, I made an object called sphere that used a position vector and to keep track of the x,y,z values of the shape. The AstroGiant class takes in these values along with a float radius and PImage image. During my presentation on Friday, I made the planets using the CreateImage function of the PShape type in processing. I decided to stick to this because using a regular sphere does not allow me to wrap an image around it. I created a different angle of rotation and I tried to imitate gravity of the planets. I made a different function for each planet and used push and pop matrix to create the rotation around the sun. I  made a moon for the earth as well.

Overall, the project was really fun to work on. I feel more independent of my code and although I had a bug prior to the presentation, this was a great learning experience.

-Cesar

Link to Project(Not Working):

https://www.openprocessing.org/sketch/517102

Video:

Learning Processing Reflection

After reading sections from Learning Processing, I feel like I have a better sense of how to approach programming. I think if I read this before I started working on my midterm project, I definitely would have tried to utilize the methods of breaking down my problems into smaller, more manageable chunks. I was probably already using some of these methods in my head, just without realizing it. The debugging chapter was also very useful, and some of the tips are things that I’ve already been doing, again without realizing how practical they really are. Whenever I encounter a problem, I try to step away for a while, or talk it out to myself or a friend to find the issue. I think I don’t do enough simplifying or enough println(), so if I knew about these tips before starting my project, it’s possible that some of the problems I had could’ve been solved more quickly and efficiently. Overall, I think this was a very valuable read and gave me a new perspective on how to write and debug my code.

Final Matrix

For this I wanted to create an effect of a scene from the matrix movie. The goal was to simulate an event horizon as you enter the matrix. To do so there was a need to create an array list to get, set, and add new values to replicate particles moving in certain directions to show a navigation effect on keyPressed. The most trouble I had was mapping functions for the mouse movements and FOR loops for the navigation to get the effect to work. I spent a lot of time in the tutoring center trying to understand the coding I was trying to do and in the end I ended up brute forcing my way to making the code work with the help of a tutor.

https://www.openprocessing.org/sketch/516427

Midterm Project 2

For this project, I drew inspiration from my earlier Research Project on Stan Vanderbeek and Ken Knowlton. While not to the extent of their work, I wanted to produce the lighting backdrop for a DJ’s stage.

Initially, I wanted to pan the “lights” according to the mouse position on the x-axis and music as an input for the y-axis of lights. Instead, however, I used keypresses and mouse click to randomize the light. More so, the mouse-pos produces a sphere that resets with each mouse click. The mouse click also allows for small squares to be drawn in an effort to show the random lights a DJ stage would have during a show. I wanted both a mouse click and mouse press to randomize lights because it allows for quicker changes that help to create a more realistic DJ light thematic.

I ran into issues with the for loops and using specific transformations for one loop, but instead it changed for all. One aspect I would like to still add is the planning of the mouse since I think that would allow for more user engagement.

https://www.openprocessing.org/sketch/516422

Midterm Part 2

I was pleasantly surprised by the way this project ended up. 

I originally wanted to make a city builder, where you could click and drag to create a building at the size you want it and it would default along the two axis that the buildings above are built upon. This was my first time working in 3 Dimensions, and I was not able to give the user this flexibility and figure out how to automate all of the rest of it to where it would still look good. Instead, I manually created the buildings (originally were going to be objects in a class), and then created cloud objects that the user could place by clicking. The user is also able to control the time of day by dragging the mouse from left to right and vice versa, and along the transition from day to night, the sun turns into the moon. I also added twinkling stars to the sky, which I originally wanted to fade in and out instead of blinking, but the dominant method for doing this was to change the opacity of the refreshing background to where the stars are slowly blotted out, however I needed the background at full opacity so that the sun/moon didn’t drag.

I had originally wanted to add lights and detail to the buildings, create a ground, with two roads running along the opposite axis with cars periodically driving across. My difficulties with the Z-axis in the inclined me keep the scene simpler if possible. When I wasn’t able to allow the user to create the buildings in the scene, it kind of changed my game plan. The original idea was to give the user a dynamic background and allow them to arrange the buildings as they like, however in a way that reversed. In the final iteration the user controls the background and the foreground is already set.

My code for some reason doesn’t function properly on Open Processing, but if you’d like to interact with my artwork you can copy the code from there into processing and it should work just fine. You can find the link here.

You can also see a screen recording of the functionality in my presentation.

Midterm Week 2

For my midterm assignment, I made a “Match Maker” game. I modeled it after those old Love Tester / Match Maker games that you still see in some bars. I knew I wanted the project to look super cheesy and silly, so I used a background made of a million hearts. I also wrote (mostly joking) levels for each of the bars.

My sketch has 4 classes: Bars (to draw the bars), Day (randomly named, contains all text), Lines (contains all the lines), and Rectangles (creates rectangles of random height inside the bars). At first, I didn’t understand classes, and my code was way too long to use comfortably. Once I got the hang of them, my code became easier to read and edit.

The responsiveness here is fairly simple. When you click the button, rectangles of random heights are generated inside each bar. I also added a second element just for fun — you can sort of cheat your results. When you click inside one of the bars, it creates a new red rectangle exactly the size of one of the sections. You can fill your bar up all the way if you, like me, aren’t satisfied with your results.

This project turned out pretty much exactly how I wanted it to, with the one exception being my difficulties uploading it to Openprocessing.

Midterm pt. 2

At the very least, I wanted to make a rain cloud with lightning, which I think I was successful in. I remember initially setting out to make some sort of landscape so that I could become more comfortable with making classes, but I used a few classes without it anyways. I remember also wanting to include a sound/audio element to the piece so that when clicked, thunder would sound as well as lightning would appear. However, it was taking me some time to figure it out, so I dropped it. Arrays were my biggest challenge with this project and so I binged a lot of Shiffman videos/tutorials. I had the hardest time linking arrays successfully between classes and the original sketch, and just overall understanding the concept of arrays. After spending a few hours trying to figure out how to incorporate rain with an array, Shiffman actually had a great tutorial on it; it helped me make my rain more detailed by giving it an illusion of depth. His tutorials series on arrays also helped with creating my other “wisp” clouds. I also went through a few different iterations of lightning, before deciding to work with a line rather than a shape, as it might’ve be the easier/more concise option. If I were to do this project differently, I would take the time to actually add sound since I think it could add a lot to the sketch’s concept. Also, after looking through some of my classmates’ pieces, I might also want to make it more interactive, maybe by having a person with an umbrella and the rain ceasing to fall when it hits the umbrella.

Link to sketch: https://www.openprocessing.org/sketch/516567

Midterm part 2

I initially set out to do a fully dynamic aquarium where the sharks would interact with the fishes. I wanted the sharks to be able to rotate around the fish as it tries to capture it, and when it does, it’ll get bigger, as if it had actually eaten it. This is something I was struggling with.  So I had the shark simply swim by the fish. However, I did achieve a fully dynamic system regarding the fish themselves. Before it would simply move in a constant linear fashion, but now it looks much more natural.

The fish are nicely coloured and they bounce back naturally. What I was struggling with for a long time is having the shark class and the fish class separate, which wouldn’t work because I wanted to local variables in each with each other. What I didn’t understand was why sometimes the program would work and sometimes it wouldn’t. I couldn’t for the life of me figure out what was wrong with the code.

Since I gained a deeper understanding of how classes work from this, I would have made an interaction between the fish and the shark. What I was trying to do was have the shark move freely while the fish try to move away in a random speed. This function is in my code, but I couldn’t figure out how to make it work.

Otherwise, it is a pleasing generative  visual of fishes in an aquarium setting.

Midterm Part 2

For my midterm part 2, my original plan was to make a archery came but that heavily involved arrays and vectors and I couldn’t figure out how to get an arrow to fire with aim. So I started to work on one arrow hit and did transitions and scene changes to try to tell a story instead. I think the story came out great too but I feel as if it gets told in too short of a time. The hardest thing to deal with for me was classes there was always somewhere I messed up and finding that bug would always take me forever. However, without classes, my transition idea wouldn’t work so I had to keep creating new classes and the more I created the more packed and confusing the code got for me.