triangle field started as a simple sketch put together in a few hours on a sunday and its been good to see it evolving since. there’s that power of the triangle combined subtle shading that gives the impression of viewing something in 3d. its very simple and visually stunning. originally, i came across andy gilmore’s work on flickr and thought his geometric designs using triangles were beautiful and i couldn’t help to imagine what it would look like in motion. the shading between the triangles had to be smooth for it to maintain the illusion of 3d, so naturally if i ever want to create anything smooth looking or moving, i throw in some of the ol’ perlin noise.
the app is built in openframeworks, and along the way i wrote some life-hacker addons so i could have more control over the app at run-time with the idea that it will eventually become a live visual tool.
before writing the color picker addon, i would have to go into photoshop, select a colour i liked and manually copy the colour values into my code. you can imagine what a pain in the arse that was and not too mention time consuming. the colour picker is a replica of the mac osx colour picker in the way it looks with a couple extra modes. you can set it to automatically traverse through the colour spectrum – guess this is handy when you want a smooth colour transition to happen over a period of time. also there is a mode for random walk, where its kinda like watching an insect crawl around over the colour spectrum – where ever the inspect walks, the colour changes to its position.
making visuals react to music is a pretty tricky thing to set up. firstly you need to do a fft analysis on the audio and apply windowing so that the lower parts of the spectrum look like they have the same sort of intensity as the higher frequencies. then you want to normalise the data so that values you get back fall between the range of 0 and 1 – this ensures you have the audio data under control.
i have now come to the conclusion that the fft analysis doesn’t have to be super accurate just as long as it looks good and is clear. my code is based on avsys and dave bollinger’s fft octana processing example (more on the OF forum). at the moment, the ofxFFT addon does two useful things, returns the normalised average audio power and returns a manipulated array of audio bands which ive used for distorting the triangle field.
in the openframeworks core (exculding addons) there are two possible ways of receiving audio data, one is from an audio file like an mp3 or wav and the other is through the microphone jack. the methods for getting this data are different but they both return the same type of information, so i created an abstract class called AudioAbstract which both AudioFileSpectrum and AudioLiveSpectrum extend. the idea is to be able to use file audio data and live audio data as if it was the same thing and be able to swap them out at run-time.