November 2010

RubyOnAcid: More fun with enhanced CombinationFactory…

This time, hooked up to Ruby-Processing. I should have logged the factories assigned to each attribute, but didn’t, so the titles are my best guesses as to how they were generated.

color channel on LoopFactorySineFactory plus… what?the random stache

Lissajous plus RoundingSine x, Sine2 y, Loop redLissajousFactory

Factories chosen are still completely random, so I’m throwing away ten times as many images as I’m keeping. I bet the really mind-blowing stuff will happen when I add a genetic algorithm.

development
ruby

Permalink

RubyOnAcid: CombinationFactory::REBOUND…

Added a simple constraint type to CombinationFactory that causes values to “bounce” off of the upper and lower bounds:

-0.2 -> 0.2
-0.1 -> 0.1
0.0 -> 0.0
0.1 -> 0.1
0.2 -> 0.2
...
0.9 -> 0.9
1.0 -> 1.0
1.1 -> 0.9
1.2 -> 0.8
...
1.9 -> 0.1
2.0 -> 0.0
2.1 -> 0.1

So when scaled to screen dimensions, for example, x and y coordinates can seem to “rebound” off the edges of the screen, or an object can “bounce” back and forth between two colors, or minimum and maximum sizes. The SineFactory did some of this before, but this gives an abrupt reversal of direction instead of a smooth curve (and sometimes the former looks cooler).

Also, I had the ExampleFactory randomly choose an operation and a constraint mode for its component CombinationFactory. Since it only used the defaults before, and since it seems I never use any functionality that isn’t wrapped up in the ExampleFactory, these rather cool features were woefully under-utilized. This should fix that.

Here’s a few sample SVG files, generated with the updated ExampleFactory:

2010-11-09_232353.svg
2010-11-09_232419.svg
2010-11-09_232816.svg
2010-11-10_011839.svg

development
ruby

Permalink

This is cheating at live-coding - I just replayed my re-do buffer in TextMate. I figured the result would be interesting if I ever want to go back and analyze my technique, though.

train_of_thought.mov

development
ruby

Permalink