Maths and Art Project


Prior to handing in my Essay I'd gone to the library to look at a book recommended to me - Physics for Game Developers, which was in the High Demand section which means you can't take it out, it can only be read inside the library. So I spent about an hour skimming the book but it was a bit complex. It assumed highschool physics and mathematics, and I did do both up until 6th form (year 12?) but that was ages ago and if truth be told I bombed both anyway (extraneous factors). Pretty pictures though and one in particular was enough to get me thinking about particle systems. Particle systems are simply a form of modelling liquids and gases by giving physics to lots of particles. However the picture that caught my interest was using particles to model cloth. They were all connected so could not stray away from their neighbours, but they could move around within that constraint. So this got me thinking, but with the Studio project, thinking was as far as it went for a while.

I wanted to model blobs of paint being thrown at a wall or dropped or... something. This would require some 3D work. The plan was to use Processing, which we had used in Semester 1's Programming for Creativity paper, but I've never used the 3D functions. They are easy though, all the 3D projection is done for you. But still, I hasn't sure how this "game" was going to look.

The day before the performance I found the time to go back to the library and check out another book that was on the library catalogue that I noticed could be taken out. Physics for Game Programmers came with me for later reading. It looks like a really good book, although one I didn't really have time to read, I read the first chapter and finally learnt what ∑ means (apparently I should have known this from highschool). the first chapter also covered other maths symbols, greek symbols, coordinates and systems, matrices, matrix multiplication and rotation and differential equations. Everything I'd hoped to learn in Maths class this semester in about 6 pages.

But I had to just start doing, as time was running out. This greatly annoyed me. I would really like to spend a couple of uninterrupted weeks actually exploring this project properly. There are loads of factors at play here, but the only one I can attempt to do better with is some form of time management. I'm not alone, it seems to be a common story but it's annoying, as the briefs often convey how one is to experiment and explore a subject over time but the reality is to cram as much work into the thing with the closest deadline then cram the next thing then the next. Not so much exploring done over a period of weeks.

On Monday (and a public holiday) I helped a classmate film their project and in return I was given some advice and pointed in the direction of a physics library written for processing. The advice, well, perspective, was that I don't have to go inventing the wheel to get the job done. I don't have to write all the physics myself (given the time) when other people have already done that. I just need to use what is available. It's like wanting to drill holes so building a drill. What is the point. Toxiclib was the name of a physics library that could model liquids.However while browsing processing libraries I also came across MSAFluid library, a library for solving real-time fluid dynamics simulations. This sounded interesting too so I browsed the various demos and simulations from both libraries and decided to change my project a little bit. Rather than splattering blobs of paint, I decided to use the particle system in the Fluid Library to model paint of some sort.

It took a couple of hours to do the most basic thing - install the libraries in processing. Where are the instructions for this? I wound up discovering that on my own. I then spent several hours picking through the code and simplifying it, taking out bits that I didn't need so I could understand it better. This took until the hand-in day and I encountered part of the rendering in OpenGL code and couldn't quite understand how it worked. If I could just have had a couple more days to spend on this on it's own (and not be interrupted by outside things as was the case all weekend). Also the API reference was a bit iffy. I'd love to have picked apart the source code (in Java) for the library and just re-implement a version of it in my processing program, but... time...

But I started to realise that the concept had been sort of proved. It wasn't quite a game yet and lacked controls that I wanted to implement such as a colour picker and physics adjustments along with ability to save images. But it did use maths to model fluids (nature) and was capable of producing (questionable) art. So I used it and took screenshots and burnt the program and screenies to CD and handed it in. I considered briefly working on it more and handing it in again but... I'm over it. I want to get the other submissions due in the next week and a half done instead. Below is an example of what it produced, it's been coloured in photoshop, in it's current state it only produced white dots (which would later have looked more like liquid if I'd had the chance).

swirly pattern