Walking Lines 2

August 4th, 2008

Walking lines 2Continuing on from the original walking lines I did in Processing, I went on to develop this version of it. This is done effectively the same way as the original, but the code is cleaner and it provides for more variation. It also runs slower.

This version should allow further development to make the lines even more random by separating all the variables, where the original was more limited since the numbers were largely defined within the line parameters.

This version is also technically more stochastic then the first one as well as the lines are added to and built on using the += command to add the new line position to the previous line position. Unfortunately this still draws a new line every frame that is not necessarily joined to the line from the previous frame.

Read the rest of this entry »

Walking Lines 1

July 31st, 2008

Semi-random lines sketchIn the week 2 tutorial for KKB211 - Computational Arts 2, we are looking at doing walking lines in our chosen development tool.

Walking lines are effectively randomly generated paths that the lines follow to create a random image.

I have been using Processing for this particular focus. Thus far I have random lines, however they don’t follow any particular path as of yet. This is effectively still walking lines as the position of the lines is added to and built on. Unfortunately this actually draws a new line every frame that is not necessarily joined to the line from the previous frame.

Have a look at it online here.

The code used to do this is extremely simple and just involves a few random variables based on the width and height of the canvas. I don’t believe this is entirely stochastic because the randoms are tightly controlled, but it is random within its boundaries (unless you want to get into the nitty gritty of it, which I don’t).

The source code is available after the jump.

Read the rest of this entry »

Just a minor fix to the draggable box I made the other day. Previously it positioned the box so that the top-left corner was aligned with the mouse. Now, it centres the box horizontally and vertically behind the mouse.

It is available online here along with the full source code.

The changes made to fix this are pretty simple, and the code changes are shown below.

Read the rest of this entry »

I have added some mouse controls to my kaleidoscope so that the type of motion changes based on the position of the mouse.

The motion is slow if the mouse is in the top-left corner and speeds up as you move in any direction from the top-left, moving in different ways depending on the direction of the mouse.

I have added the ability to be able to control the animation by clicking the mouse as well. This is commented out in the online file and in the source code, but can easily be turned back on by uncommenting it.

It’s available online here.

If the comments are removed, then no animation will occur until the left mouse button is pressed. When it is pressed it will behave the same way as when the mouse button control is commented out. When the mouse button is released, the animation stops.

Note that with the mousePressed() function commented out, nothing will happen until the mouse first moves over the sketch.

The source code is below.

Read the rest of this entry »

Spiral Kaleidoscope

June 6th, 2008

Spiral KaleidoscopeBuilding on my randomly generated spirals developed earlier, I was aiming to get the spirals to either spin, or change either on their own, or in response to a user’s input. I have not yet been able to get it to work like this, but I have gotten it to change and spin with the appearance of a kaleidoscope.

Have a look at it online here.

Each time it loads, a random spiral will be generated, as with the original, the spiral will then disappear into the spinning kaleidoscope. The source code is below.

Read the rest of this entry »