circles

…whirling silently in space…

My idea for the lighting effect was to use the sine of the angle of each criss-crossing line as the basis for the line’s saturation and brightness (using the HSB colour mode rather than RGB). That way, I figured, the lines would be brightest when sloping at 45 degrees, and darkest after they had turned a further 90 degrees. That should suggest a constant light source emitting parallel rays onto the rotating blobs.

It didn’t work, however, because the lines never changed their values, and it took me a while to work out why. By using pushMatrix(), translate(), rotate() and popMatrix() to handle all of the complex calculations, the angles remained constant because the drawing window was translated and rotated, not the lines themselves. I need to go back to my original intention to recalculate new values for the co-ordinates of each end of every line in every frame.

This may take a while…

Tags: ,

Wednesday, April 29th, 2009 coding No Comments

…and the world is like an apple…

There was, indeed, a scaling factor creeping in, thanks to a fundamental error in my formula to calculate the y co-ordinates of the cross-hatching lines. I was introducing references to the centre of the screen, when the calculations should be purely relative to the blob’s centre.

At some stage, I intend to give the cross-hatching lines a bell-curve rather than a completely random distribution, which I hope will reduce the bunching at the sides of the implied circles, and to even out the spacing of the blobs around the centre. The main remaining task, however, is to attempt my proposed lighting effect. I have no idea whether it will work or not, but that’s what experimenting is all about.

Tags: ,

Tuesday, April 28th, 2009 coding No Comments

…past the minutes of its face…

Yesterday’s progress in rotating the blobs around their own centres was achieved surprisingly easily, thanks to some timely reading of the third of my new acquisitions at work, Dan Shiffman’s Learning Processing, and using my old adversaries pushMatrix(), translate(), rotate() and popMatrix(). I’d been intending to calculate the translations of each line’s start and end co-ordinates from frame to frame, so thanks to Dan for saving me that effort (which I’m sure would not have been straightforward).

Today’s task, however, of making the blobs look more like circles, has gone slightly awry. As you can see, it works well for the central blob, but the others aren’t behaving at all. The lines are in the wrong places and, although you can’t tell from the still image, they are now spinning around points that aren’t their centres. An offset or scaling factor must be creeping in somewhere, but I can’t see where.

circleslines009

Tags: ,

Monday, April 27th, 2009 coding No Comments

…like a clock whose hands are sweeping…

This is a little more like it, but there are still several steps to go.

Tags: ,

Sunday, April 26th, 2009 coding No Comments

…running rings around the moon…

Well, it’s not quite what I had in mind, but it’s progress of a sort.

Tags: ,

Saturday, April 25th, 2009 coding No Comments

like a carousel that’s turning – d springfield (again)

My mug at work has a pattern on it that could easily have been created with Processing. Several circular images are spaced regularly on a black background, and each image is made up of about fifty random lines criss-crossing the patch. I decided to create a Processing sketch using this design as a starting point, but adding some movement to make it a bit more interesting. The images should all rotate about a central image, and each one should also spin around its own centre at a random speed.

This is a candidate for practicising Object-Oriented Programing, so my first attempt looks very primitive because it concentrates on moving the images around the central one. I can add the spinning at a later date, and refine the way each one is drawn whenever I want to. My ultimate goal is to add a lighting effect, to give the impression of light and shade that changes as the images spin, but for now I need to focus on the basics.

Tags: ,

Friday, April 24th, 2009 coding No Comments