Week #2
Ok I'm stopping explaining this like a weird robot, so:
This one works the same as the previous one, except the points are not random, but are generated with noise. I expect it to look quite different — instead of being sharp and all over the place, the points would move in a more "directed" / soft line, with some curvature to it.
Ok so for this week I sort of wanted to redo the animation system I started last week. I wanted to be able to specify position, rotation, and scale by number of frame, and have it interpolate between the frames. That was a bit of a challenge to figure out, and had to start with a different mindset than I'm used to... I also wanted the animation class to be further abstracted so that it'll allow me to use whatever shape I want. Ideally it should also have children that have their own animation while being tied to the parent (like moons around a planet if that makes sense?).
Admittedly this whole thing is a bit beyond my abilities but I feel it's a good opportunity to learn more new concepts and to sharpen my skills while I'm still doing fine with the subjects covered in class... So I asked for some help and guidance (thank you Lior!). It was very helpful to think about how to do some parts of this together, having to explain it to each other and raise potential problems or comments. There are a few parts of this code that were pretty much copied and pasted from Stackoverflow as is and that I don't fully understand, like this part:
But I understand its probably along the lines of being a shorthand version of going through all the posKeys, looking at each two consecutive keys, and sorting them, so we should end up with a Map of sorted posKeys. I learned about this other map — the Map() — which is a js class that lets you specify key-value pairs, similarly to objects, only they're ordered so they're sortable (At some point I started watching these videos about sorting algorithms and now I really want to get into implementing and experimenting with something like this). Anyway, using the Map() class essentially allowed me to have keyframes — each specified frame has a value that belongs to it.
Unfortunately I ended up not having enough time to actually create something more sophisticated visually. But it's like I have this tool now, a sort of template, that might come in handy in the future for many different things. I might try to figure out a way to automate instance creation because writing the literal keyframes by hand becomes very tedious very fast. But it does offer a lot of control, and automation would probably cost that. That's something I guess many creative coders face and that I also encountered last week — how to balance the creation process so that on one hand you get to direct it, and make it in your style; while on the other hand a big part (a big advantage!) of working in this medium is actually getting unexpected outcomes, so you also have to let go of some control to allow that to happen. This animation system is definitely more of the "control-freak" side of the spectrum, but I think it could potentially be used to generate unexpected results between different instances or between the different parameters as they all have their own separate keyframes.
Ending with this mesmerizing thing I can't take my eyes off of: