This post marks the beginning of another short series, this time focusing on my efforts to improve my linear algebra skills. To start, I tried implementing a dynamic field of wind, which I then used to blow a bouncy ball around a box.
Each fan is spawned randomly into the scene with a random magnitude of force. The direction and reach of each fan's wind field is designated by the green lines extending from them.
Each frame, a fan finds where the ball is relative to itself and calculates the necessary rotation to aim towards the ball. The direction of the wind vector itself is also recalculated after rotating to make sure it actually pushes the ball in the proper direction. The force from all of the wind vectors currently acting on the ball get summed together and applied to the ball, causing it to get blown around inside the box.
Incidentally, I also learned some new tricks when it came to using Unity's Animation tool while animating the fan blades.
Quaternions still make absolutely no sense.
Comments