Old school demo effects: #2 – the raster bar

9/02/2010

I have been using processing for a while now, mainly as a sort of relaxing digression from coding web apps & scripts all day. As a child of the 8-bit era I grew up looking at demos which tended to have a few recurring themes. One of these is the classic “plasma” which I’ve already coded and another was animated “scrollers” which typically consisted of a fuax-3d bar which would bouce up & down the screen.

I created this rough version last night before bed. A scroller class gives it a random start/end color and then a number of intermediate stages are interpolated between them. The brightness of the interpolated colors varies with time to give it a bit more life. Its not really finished yet. Code below the video.

Read the rest of this article »

No Comments

Beginnings of a particle system in processing

1/02/2010

I have been getting more & more into processing and who doesn’t love particles? I’ve started the basis of a little particle system, there are plenty of examples at openprocessing.org but I wanted to write my own as an exercise. It’s been quite some time since I properly used even pretty basic maths for physics so I’ve been enjoying revisting old uni notes & following through my old engineering books.

I have it colliding in a rough way with the walls. There’s no horizontal component to forces yet, it just drifts as time increases rather than falling straight down. It goes crazy as I’m changing the “gravity” throughout. Hopefully this will continue to grow as I add bits and (re)learn the concepts. So far this probably about 100-150 lines of code, not a lot.

No Comments

Processing – spiraly line draw thingy

31/01/2010

I’ve been reading through the vector section on the processing.org reference site and quickly played around with one of the examples showing locking to the center point whilst the mouse moves around to draw spirograph style patterns. Hitting spacebar will clear the screen whilst left/right will increase the size of the circular path the target point moves around. Up/Down adjust the line alpha. This is the sort of quick prototyping that makes processing so much fun. Yeah, fun. If I was a kid these days with a linux setup (or really just the opendisc on dvd) I would consider myself lucky. Then again I grew up playing around with assembly on a C64. I don’t think I’d give up those days, being around since the 8bit era (and old enough then to appreciate it) I’m always amazed when I sit down at my linux box at just how far we’ve come.

I’m even more amazed by the huge amount of great open source software. You really do not need to pay or pirate to make money with a computer these days. Especially as a coder. If you’re a .NET person by choice fair enough. I don’t think I could take a job now that side of the industry, I’m pretty much a FOSS and FOSS only sort of person now. I am of course, incredibly lucky to be in that position. A lot of dev’s can’t make those calls and have to work with whats given.

I seem to have gone off on a tangent there. Code follows after the jump. You can paste that into the processing editor and hit play.

Read the rest of this article »

No Comments

Old school demo effects: #1 – the plasma

31/01/2010

I have finally gotten around to playing with processing – a java based set of libraries and functions for visual programming. It’s really a lot of fun. It’s great for doing quick and easy interactive visualizations. With minimum code you can start drawing simple geometric shapes and when you start throwing around a few sine curves and mouse co-ordinates you’d be surprised what can come out.

One thing I’ve always promised myself I’d code was a plasma effect. A stalwart of the 8-bit demoscene I’m not sure why it’s taken so long for me to get round to actually coding one from scratch. As you can guess, processing made it pretty straightforward. Here’s the result:

This plasma harks back to one of the first group assignments I had at university where we were given an FPGA and we had to load in a picture of Lena and do something with it. The plasma never materialised, instead we ended up doing a convolution kernel. I can remember we had around 2 weeks to do it (teams of 4 or 5) and write a little report. I wrote this in the space of an hour or two.

If you’ve never used it before and have always wanted to do a bit of abstract graphical programming I’d highly recommend it. The core keywords/methods are all pretty sensible and once you’ve worked through a few basic “sketches” the whole thing begins to gel easily and you start thinking less about the code and more about what you want to do on screen.

Here are a few images I’ve created via scanning each sampled point and matching it with others in the image within a threshold. A bezier line then connects the points.

No Comments