Posts tagged ‘java’

FreeVibes

Finally the summer-holiday arrived, now its time to do some fun coding.

I bought myself a new mobile, a Nokia 6300, it’s got all the bells and whistles. Hmm well at least those I could afford. I choose this mobile because it has : Java, mp3 -player, bluetooth and memorycard.

I must admit that i might be a bit of a nerd, so I just had to code something for it. And after “hello world” I found a small and some would say useless application to code.

FreeVibes

I must say I got inspired by vibelet and the article in wired ( Hold the Phone, It’s a Sex Toy ). As the title suggest, its well vibrating. I think that vibelet – though i haven’t seen their program, must be making quite an profit. Because getting a java-enabled phone to vibrate constantly, is quite easy.

So now its Time for FreeVibes, a free software version.

Continue reading ‘FreeVibes’ »

Java Rippel applet

ripple apple screenshot

I had been messing around with creating a platform for experimenting with extended rules for “life-like-automata”, and although the code seemed to work just allright. I was horrible slow at rendering, and I decided that the next step were to optimize the rendering / drawing.

Well one thing lead to another – and i decided to make a small applet, were the drawing routines were optimized. Using a bufferedImage and setting the pixels one by one. And then I found this cool algorithm, for 2d water (Link).

It simulates water rippling, by using to buffer arrays with heights, and using them to calculate the speed and hence the distribution of ripples. There are a nice description of the algorithm at the link mentioned above. The short story is that you get an heightmap, and are able to calculate the next iteration of heights using the last height map, then you switch the buffers and repeat the procedure. And in between you render the heightmap. Unfortunately I’m not familiar with any algorithms for shading an refraction, so i just draw the heights using a simple gradient.

But the effect is really nice anyway. I didn’t include the applet in this page, as it cpu-intensive. It iterates through every pixel at each iteration, and just keeps on iterating. the nice thing about it, is that the speed doesn’t depend on how many ripples / activity there is.

small
normal
large

ripple source code

Java life simulator

Having played a bit with cellular automata’s – and looking at various other rulesets. I started to wonder what the result would be if every cell had i different ruleset, or just different types of cells interacting.

And what if there were mutations and sexes involved ?

Continue reading ‘Java life simulator’ »