Zachary Kanfer
I write about programming, music, and comedy.
3y ago
Expect to change your generative art
Zachary Kanfer

My early generative art used direct pixel values to place elements. I rendered it in a larger size, and nothing moved.

I stared at my computer, confused why my carefully placed shapes sat awkwardly in the upper left corner. I realized the locations were hardcoded inside a small frame; in a larger canvas, they were in their original positions. I had to update every single pixel number. But they were still hardcoded.

If I had expected my art to change, I would have made it flexible.

Flexible art is better art.

If it's rigid, a lot of code must be modified to make simple changes.

When your vision changes, you'll have extra work to change your art. It can make your art not take advantage of randomness, which can give amazing surprises. Worst of all, you'll keep subpar art to avoid fixing it. Flexible art gives you the ability to think at a higher level, treating your functions as new building blocks.

Here are some ways to keep your art flexible.

1. Extract everything possible into a function or variable.

Change a single variable and watch it affect disparate places across your art. Newly created functions can be used in other art pieces. Your code will be better documented by coming up with names for these values.

2. If you need a value inside a range, calculate the fraction of the range.

This would fix the mistake I made in hardcoding pixels. Rather, multiply the canvas width by how far across you want the point. Changing the range also changes the calculated value. Color values can also be calculated inside a range. Angles can be based off a starting angle, so you can change the angle the entire shape rests at.

3. Know your art framework. You don't know what you want to do unless you know what you can do.

I wrote functions to graph polygons, before finding out Quil already has them. Look through your art libraries, and you'll find new, useful features.

And unlike my early experiences, you'll find new options, and be inspired for better art.

0

Atomic Essay

Comments

What will you write today?

Write, publish, get feedback, and become a better writer.

Trusted by 75,000+ writers