Creating generative art in haXe and OpenFrameworks (March 2011)

April 4th, 2011  |  Published in Uncategorized

It’s already the 3rd month of doing a piece of generative art everyday. Here are some selected pieces.

Reused previous month’s feather code to make a sensitive plant.
20110225_210355

Backed to play with abstract geometry. I like its sketch style wooden texture.
20110227_191144

Following one gives some nice harmonic color.
20110305_202302
20110305_202309

Replacing lines with circles, it’s now more saturated.
20110306_202618

Since Martin Lindelöf made available its clothx physics lib, which is based on traer physics for Processing, I used its spring/attraction system to draw some stuff.
20110308_193753

It is very easy to create beautiful structures with the lib.
20110311_031007
20110311_031333

More organic one. Stroke size is proportional to particle speed.
20110313_172705

Linking up the particles.
20110314_161400

Sorting the particles before drawing in each frame.
20110315_171922

Old school generative curves. Can you hear the sound?
20110318_214522

Smaller, moving strings.
20110321_173927

Fixed, more complex strings with rainbow colors.
20110322_172246

Scaling up.
20110323_173620

Scaling down with blood vessel colors.
20110326_001833

Even more complex strings. Simply drawing them down but not painting them frame-by-frame like the previous ones.
20110328_195131
20110329_232009
20110330_033407

Colored version. It looks like coral. Maybe the algorithm is similar to coral’s growth.
20110331_235757
20110401_223752

Tags: , , ,

Creating generative art in haXe and OpenFrameworks (Feb 2011)

February 22nd, 2011  |  Published in Uncategorized

I continue the journey of creating a piece of generative art everyday. And I am still using hxOpenFrameworks. BTW, since I don’t have a Mac running at this moment, I can’t have a Mac build. And actually I’m still messing with the Linux build… So hxOpenFrameworks is currently Windows only. I will release it to haxelib once it is cross-platform.

Anyway, here below are the selected pieces from my set of creations.

After last time I discovered the beauty of physics, I went with some typical simulations…shooting bullets.
It is not in real-time, but a frame-by-frame rendering. It would be nice if there is a haXe binding to PhysX or something.
YouTube Preview Image

Following is simply putting some circles from inside of a grid of sands. Look pretty like corruption.
YouTube Preview Image

And then there is a series of connecting points on a circle. It generates soooo many patterns with a single algorithm, I have to align the variations in a grid. Don’t draw them on a paper, it may summon a fire ball or something, don’t say I haven’t warned you ;)
20110128_010311
20110129_003509

Since I was leaking idea, so better do some old school recursive stuffs… Turn out applying color on them can give you nice harmonic color scheme, and the proportion is perfect!
20110201_000052

I like the following one very much. It first generates an array of points according to some regular polygon math, then sorts them according to the angle from origin and finally links them up.
20110207_022130

Same as above, but reversed part of the math so the lines point outward.
20110208_002628

Still playing with the above idea, but applied lots of tweaks to bring the interesting parts out.
20110210_064234

In the latest weeks, I have been trying to create more concrete graphics. It takes more time then messing around with math equations, but I have more artistic control. First one plays with circuit board like structures.
20110216_103158

Applying Tron-style color.
20110217_080342

Second concrete thing I created is a feather, as I really like birds. I used the easing equations(which are usually used for tweening) by Robert Penner to create the curves.
20110220_135143

Creating a pair of wings is easy when you have feathers.
20110221_213250

And finally, why not have 3 pairs when you simply can? Here comes a seraph.
20110222_020632

Tags: , , ,

Creating generative art in haXe and OpenFrameworks

January 15th, 2011  |  Published in Uncategorized

It has been some time since the start of building hxOpenFrameworks, the haXe binding to OpenFrameworks. Actually it is already around 80% complete several weeks ago. I was facing some GC problem on the use of ofSoundStream, but finally I’ve solved it with the help of Hugh. As a by-product, I’ve made a binding to RtAudio, a cross-platform real-time sound input/output API. However, I think I will wait till OF 007 and haXe 2.07 is released before really releasing hxOpenFrameworks.

In order to test it, I’ve been using it for some little projects. I decided to create (at least) one piece of generative art everyday… right, everyday starting from the 1st day of 2011. Quite similar to what Keith Peters did some time ago (art from code). The process is pretty fun once I had got used to start my day by coding some art.

Accidentally I found setCircleResolution a very interesting function to play with. It controls how a circle is approximated by drawing regular polygons. Below is circles with radius increasing and resolution(number of sides of regular polygon) decreasing.
20110103_082211

Sometimes the generating process is even more amazing than the final image.
YouTube Preview Image

sin/cos/tan are also interesting functions that often give you unexpected results. Below is a combination of sin and tan.
20110109_094501

Writing recursive/iterative code is the easiest way to produce complex graphics with few lines of code. Spiral forms are particularly attractive, as there is a point of focus.
20110106_202323

With some modifications, it looks like some kind of rose.
20110107_080604

Below is my favorite piece at the moment. I used physaxe for physics simulation. Thousands of particles(in fact, tiny circles) are shot from outside of the canvas, producing trails of blue. When they collides, some red will be drawn, which look like sparks. The generating process is recorded, you can find it on youtube.
20110113_2000

Finally, all the codes of the above pieces are open source, can be found in the description of individual flickr/youtube page. I’ll post some more interesting ones next month.

PS. Nicolas Barradeau is producing a series of basics in generative art in his blog, which contains a lot of useful codes in AS3. Be sure to check it out if you’re interested in generating some art!

Tags: , , ,