September 9, 2009 3

triangle field

By in openframeworks, opengl

tf_090816_101206_4000x2250

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.


triangle field :: 01 from lukasz on Vimeo.


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.


ColorPicker addon


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.

ofxColorPicker


audio file spectrum fft


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.

ofxFFT


triangle field :: 02 from lukasz on Vimeo.

3 Responses to “triangle field”

  1. [...] visual component stems from an existing generative application, the triangle field, which i wrote some time back. with tr-IO, i wanted to allow people to explore the generative art [...]

  2. Jakuza says:

    Really into this. Will you be putting out an open source version of this app? I might even get into OpenFrameworks for this; I’ve been looking for this kind of effect for a long time for a new dj/vj/live project.

Leave a Reply