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 »

Random Spirals

June 6th, 2008

Random SpiralsBased on the Triangle Flower example from the Processing learning basics site, I’ve come up with a rendered image that will generate a random, coloured spiral every time it loads. It’s similar to the appearance of a kaleidoscope. You can have a look at it online here.

At this point, to see a new spiral, you have to re-run the Java, or re-load the page rather than pressing a button, moving the mouse or anything like that. Hopefully I’ll be able to get that to work soon as I think it would look pretty cool if I could get it to change as you move the mouse over it, similar to the way a kaleidoscope changes as you move it around.

I suspect it is to do with the lack of a draw() function, but when I add it in and run the spiral() function from within the draw() function, it completely changes the way the spirals render and I haven’t yet been able to get it to behave correctly.

Read the rest of this entry »