Uncategorized

Creating generative art in haXe and OpenFrameworks (May 2011)

June 1st, 2011  |  Published in Uncategorized

The fifth month of doing a piece of generative art everyday using haXe and openframeworks. As a reminder, all the pieces can be viewed from my Flickr set. Also the haXe source code for generating those images can be found in the description in the corresponding Flickr page. Here below are the selected pieces made in this month:

Drawing only part of the lines generated by midpoint displacement algorithm can give out some interesting unknown creature contours, looking into each other’s eyes.
20110501_213017

Another arrangement. It now looks like an island.
20110502_215047

Used a algorithm that I read from somewhere, that start with a point with some color, for each iteration the color spread to the neighbors with a little variation. I really love its oil-painting texture.
20110503_234909

Increased the spread’s random factor, allowing it to spread a little bit backward.
20110504_211026

Keeped changing the spread implementation. This one keep increasing its hue from the center with a probability of reseting itself (to red).
20110505_051547

Made the spread much more unstable and let there be more than one starting point. Resetting the lightness to 0 periodically gave out interesting organic layers.
20110508_003406

Well, a beautiful rainbow color cup water mark on tablecloth…?
20110509_233447

Played with fractal patterns. Full of circles in different sizes and positions in ratio.
20110515_050235
20110516_031307
20110517_003704

Used only small circles. Pretty cyber-looking.
20110522_083005

Used solid-filled circles. Colorful snowflakes.
20110524_121242
20110525_215533

Simpler smaller patterns.
20110529_164803
20110530_212615

Tags: , , ,

Creating generative art in haXe and OpenFrameworks (April 2011)

May 5th, 2011  |  Published in Uncategorized

Here comes the forth month of doing a piece of generative art everyday. Every time I ran out of ideas, forcing myself to code brought me some unexpected results.

It’s a starry night on a overcrowded planet. A simple but beautiful piece. Nothing complex there, just some random circles/rectangles placed together with a very thin layer of perlin noise as cloud. Be sure to click on it to view it in full size.
20110407_220310

Discovered an interesting wave pattern while trying to implement midpoint displacement algorithm.
20110409_202423

Below is a typical mountain created by midpoint displacement algorithm. Notice the sky and the mountain shares the same algorithm.
20110416_230603

Let it displaces in color space instead of xy-plane.
20110419_213919

Same as above but with slightly different painting method.
20110420_222149

Changing the input lines to circular form created a perspective. It’s like the grand canyon is undergoing sandstorm.
20110422_203705

I’ve also tried making procedural cloud from old-school perlin noise.
20110412_133431

Applying perlin noise in some mixed strange color spaces(YUV, XYZ, HSL) instead of regular RGB.
20110427_173428

Tags: , , ,

6÷2(1+2)=?

May 2nd, 2011  |  Published in Uncategorized

6÷2(1+2)=?

It's a question that comes around in Facebook recently (I've also read it somewhere in the past). There are two major answers: "1" and "9".

For "1", (Assuming “multiplication by juxtaposition” has higher precedence than regular division. Whether the assumption is true, is depending on which literature is being referred to. If you don't agree on it, the answer is simply 9)

6÷(2×(1+2))
=6÷(2×3)
=6÷6
=1

For "9",

6/2*(1+2)
=6/2*3
=3*3
=9

Notice the question is interpreted differently, you can tell it from looking at the symbols. One is mathematical notation, another is program operator notation.

The difference between mathematics and programming shown above is that, they use different kind of symbols(operators), so they have different order of operation.

Google thinks that is 9.
Check it yourself.

WolframAlpha thinks that is 9.
Check it yourself.

My Casio calculator thinks that is 1.

One interesting thing is, even in programming, different programming languages may have different order of operation, ie. they have different operator precedence (or operator associativity). The difference is mostly on bitwise operations(eg. << & |), and it has been a nightmare for programmers who want to port algorithms between languages. And luckily haXe, the language I'm in love with, that outputs C++/JS/PHP and others, already abstracted the different by inserting the necessary brackets in the output automatically(see here). So I'm happily writing codes in haXe and share the same result in different platforms ;)