[my weblog] [my software] [contact me]

h3's weblog

(garbage in, garbage out)

 

08 november 2008

Knack released as Open Source

It feels like opening the cage of your beloved pet and staring at him while he walks into the wild, finally free like wild animals.
It's a bit scary and you hope he is ready for this step, but you know that this is good for him, in the long run.
Knack has been my pet project for some years and starting from today it is Free Software.

Please contribute!
 
 

11 august 2008

IM me from the web

If you want to chat with me just click below :)

 
 

08 june 2008

I.T. Salaries

Sadly, in Italy you must divide this by 2 or 3...
 
 

20 may 2008

My new remix

You can listen it here in streaming:

FoalsElectric Bloom (h3-r3 remix)

or downlad the MP3

If you are a Last.fm user please scrobble it!!
 
 

23 december 2007

J2ME rotozoomer

Today I tried to code an oldschool demo effect for my mobile phone (a Nokia 3110 classic)...
I created a simple rotozomeer :)

here is the code (J2ME MIDP 2.0)

package org.postronic.h3.testmidlet;

import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class RotozoomerMIDlet extends MIDlet {

  public RotozoomerMIDlet() { }

  protected void startApp() throws MIDletStateChangeException {
    RotozoomerCanvas canvas = new RotozoomerCanvas();
    Display display = Display.getDisplay(this);
    display.setCurrent(canvas);
    canvas.run();
  }

  protected void pauseApp() { }

  protected void destroyApp(boolean arg0) throws MIDletStateChangeException { }

}



package org.postronic.h3.testmidlet;

import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.GameCanvas;

public class RotozoomerCanvas extends GameCanvas {

  protected RotozoomerCanvas() {
    super(true);
    setFullScreenMode(true);
  }

  public void run() {
    int imgWidth = getWidth();
    int imgHeight = getHeight();
    Graphics g = getGraphics();
    int[] img = new int[imgWidth * imgHeight];

    Image texture = Image.createImage(32, 16);
    Graphics tg = texture.getGraphics();
    tg.setColor(200, 200, 255);
    tg.drawString("h3-r3", 2, 0, Graphics.TOP | Graphics.LEFT);
    tg.setColor(200, 200, 255);
    tg.drawString("h3-r3", 4, 0, Graphics.TOP | Graphics.LEFT);
    tg.setColor(0, 0, 255);
    tg.drawString("h3-r3", 3, 0, Graphics.TOP | Graphics.LEFT);
    int[] txImg = new int[32 * 16];
    texture.getRGB(txImg, 0, 32, 0, 0, 32, 16);
    texture = null; // dispose the texture Image

    float tx, ty;
    float dtx, dty;
    float otx, oty;

    double cont = 0;
    double cos, sin;
    double size;
    int offs;
    for(;;) {
      cos = Math.cos(cont);
      sin = Math.sin(cont);
      tx = (float) cos * 20;
      ty = (float) sin * 20;
      size = cos;
      dtx = (float) (cos * size);
      dty = (float) (sin * size);
      cont += 0.02;
      for (int y = 0; y < imgHeight; y++) {
        otx = tx;
        oty = ty;
        offs = y * imgWidth;
        for (int x = 0; x < imgWidth; x++) {
          img[x + offs] = txImg[((int)(tx) & 31) + (((int)(ty) & 15) * 32)];
          tx += dtx;
          ty += dty;
        }
        tx = otx - dty;
        ty = oty + dtx;
      }
      g.drawRGB(img, 0, imgWidth, 0, 0, imgWidth, imgHeight, false);
      flushGraphics();
    }
  }

}

 
 

16 december 2007

Outrun

 
 

08 december 2007

For he's a jolly good microcomputer

25 years and we are still good friends :)

Good anniversary Commodore 64
 
Links:
Syndications:
XML RSS feed
XML RSS comments feed
Klip Klipfolio Klip
Klip Comments Klip

Blog friends: