summary:
I was pleased with how this project turned out! Whilst there were certain things we didn’t have time for: (eg: Ava and I had an idea of having a piezzo buzzer that made a moth noise, or using websockets for communication with the cam and follower moth), I learnt a lot in this project, and got less afraid of making changes with my class structure. This project has been great at helping better my group communication skills and I felt like I really did my part in making this project great!
My essay work has been going well. I’m finishing up now and am working with the feedback I’ve gotten. I wish I got a structure down earlier, but rereading the pdf’s from the VLE has really helped me structure my work.
One last thing, I hadn’t kept up with my developer journal recently, so I stopped doing individual weeks. I should’ve wrote down what I did every week because now I have written too much per section recently, this is something I will work on in my next year.
Towards the end of the project went reasonably well!
To start with this range of weeks, I changed my wing functions into a class, and I am so incredibly glad that I did. Since I made 4 wings for my moth which were all very similar except for the flapping (sine rotation) and the position, I knew it’d be a good idea to use methods. (Originally, I got the clipping and drawing to work, however I used many functions and I had to clip each drawn wing separately in my sketch file, which wasn’t very practical)
Later on, I really benefitted from this, as when I wanted to update the position of my wing objects, all I needed to do what change the translation x and y parameters. Since the image and wingshape needed to fit on each other in order to look satisfying when rotated, being rotated at the same point was important.

Since the bezier curve function requires 6 parameters, I really didn’t want to put them as more constructor parameters. Thankfully I had a solution! I defined 4 functions that held arrays with the necessary coordinates for the wing bezier. These functions were defined as global variables, which were then passed into the wingShape object parameter. Each item in the array was used to make the bezier wing shape.
I did have some issues with the clipping once I defined the wing array points outside of the class however, but I found the solution after some research, which was using:

Since clip is a callback function, when drawing was put inside of it, the context of the wing class is not stored. This meant that the wingClip array values were not being accessed. By using .bind the context was restored. After this fix I was so happy since my moth was finally looking very close to how I wanted it!

As a smaller fix, I feel as though the clipping made a huge difference! Initially, it was only my wings that moved, and my antennae weren’t looking much like a fox moth (one of the two moths species our project was based off). So, I drew some antennae and made them rotate using flap as well! I adore how they turned out.
Later on I worked with Luxana for feedback on where the moth should be positioned, as well as working with Ava to try and work on optimising my code. Luxana, Ava and I also worked on repositioning the UI and text.
I didn’t consider optimisation much, annoyingly. However I realised how dire optimisation was once I communicated with Ava on how slow we noticed the code was running.
After identifying which parts of the code were the most computationally heavy, I then:
- had to rework my class to remove my bezier vertexes, since this was computationally complex. I stopped using clip in my wing class, and instead used images for the wings. I had some trial and error with the shape, but I used my old wing shape as a guide and traced the moth wing texture image from there. It’s not perfect but can’t be noticed much from afar.
I also attended a session to meet the new lecturer, Zhou Zhou. I was really fascinated by how he used people as an “instrument” as they “create” sound using gestures and positions. I found his work fascinating and was interested in how he said that for each of his projects, there are different ways to come to a solution. This made me consider that in my finale year project, there may be different ways to go about my potential idea, especially if it has to do with Proximity.
what I’d do differently
whilst I am quite happy with my code, I do have some changes I’d make if I were to do this again:
- make the position all relative. If I had a relative position, and all the other moth points were based off of this relative position, then I’d only have to change one x and y coordinate, and the whole moth would move relative to that. I did save myself a lot of effort by making a class instead of sticking with functions like I was doing originally, however it could’ve been even simpler so that I wouldn’t need to change each parameter of my wing objects
- I was planning on making a moth class that managed my wing position as well as my moth body and antennae. I’d still have a wing class to manage my wing clipping and drawing but having one “moth” instance would be really convenient and neat for my sketch file. in the end I stuck with just making separate functions for the other parts of the moth.