Hello everyone,
Future posts will be on my new website:
http://www.boingboing.net/2009/11/03/secret-copyright-tre.html
This just got leaked. Scary stuff.. This can't be the future of the internet.
I've just finished 2 of the basic exercises, they are on this website:
http://home.student.utwente.nl/p.j.pelt/basic/basic.html
And I've fixed the collision on my walking dudes, thanks to the code from Jan.
Working webversion is here:
http://home.student.utwente.nl/p.j.pelt/colide/index.html
Enjoy!
Here's the code:
He will move with the mouse, and he will walk.
Now with extragratis popculture reference.
Hello there,
Today we had 2 courses:
Programming for create and Living and Working Tomorrow.
Both given today by Edwin Dertien. And it was fun!
Even homework was fun, programming an avatar (more post in the future about the little guy I'm scripting) and bring along some junk for the next time.
Short post this time, next time I'll tell about the walking animation I'm scripting.
Lay back and relax, this post is gonna be a biggie.
Alright, the RFID chair, let me start explaining how and why.
We used a office chair with a RFID scanner in the left armrest. If you put a tag in your left trouser pocket and lift your leg a little, you'll get scanned. For effect you'll first get a green beam over your face, just for scanning effect.
Here's the code, all the tags, except for mine, have been removed. For privacy reasons.
[code]
import org.onsignal.rfid.*;
import gnu.io.*; // for the exceptions
RFIDReader r;
String portName = "COM4";
RFIDTag tag;
String currentTag;
float offset;
PFont font;
int pos = 0;
int active = 0;
int showtag = 0;
PImage pieter, andre, arthur, douwe, herjan, ineke, irene, jan, jonas, martijn, martina, reinout, sarah, siewart, thomas, tom, bram, joost, unknown;
class TagListener implements RFIDListener
{
void tagAdded(RFIDTagEvent e) {
active = 1;
currentTag=("Tag " + e.getTag() + " was added to reader " + e.getReader());
tag = e.getTag();
}
void tagRemoved(RFIDTagEvent e) {
println("Tag " + e.getTag() + " was removed from reader " + e.getReader());
background(0);
}
}
void setup() {
size(2704,1050);
background(0);
pieter = loadImage("pieter.jpg");
andre = loadImage("Andre.jpg");
arthur = loadImage("Arthur.jpg");
douwe = loadImage("Douwe.jpg");
herjan = loadImage("Herjan.jpg");
ineke = loadImage("Ineke.jpg");
irene = loadImage("Irene.jpg");
jan = loadImage("Jan.jpg");
jonas = loadImage("Jonas.jpg");
martijn = loadImage("Martijn.jpg");
martina = loadImage("Martina.jpg");
reinout = loadImage("Reinout.jpg");
sarah = loadImage("Sarah.jpg");
siewart = loadImage("Siewart.jpg");
thomas = loadImage("Thomas.jpg");
tom = loadImage("Tom.jpg");
unknown = loadImage("unknown.jpg");
joost = loadImage("mudkipz.jpg");
bram = loadImage("riverside.jpg");
try {
r = new RFIDReader(portName, new TagListener());
} catch (NoSuchPortException e) {
println("Port "+portName+" was not found!");
} catch (PortInUseException e) {
println("Port "+portName+" is in use by another program.");
}
}
void draw() {
if (active == 1) {
showtag = 0;
background(0);
pos += 4;
fill(#5BFC00);
//line(1690, pos, 2700, pos);
rectMode(CORNERS);
rect(1690, pos, 2700, pos+10);
if (pos > 800) {
pos = 0;
active = 0;
showtag = 1;
}
}
if (showtag == 1) {
if(tag.equals("fc:62:4c:41")) image(pieter,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(jan,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(herjan,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(bram,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(irene,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(tom,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(martijn,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(thomas,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(jonas,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(siewart,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(reinout,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(sarah,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(ineke,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(arthur,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(andre,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(martina,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(joost,0,0,1670,1050);
else if(tag.equals("Tag removed")) image(douwe,0,0,1670,1050);
else image(unknown,0,0,1670,1050);
}
}
[/code]
Let me explain the code:
Once a cart is scanned, active is set to 1. If active is 1, showtag is 0 (so no image is shown) and it starts the beamer green line output. When it's finished with that it sets active to 0 and showtag to 1. If showtag is 1 it will compare the scanned tag to the known tags and displays the correct image with the registered tags. If the tag is unknown it wil display the unknown user image.
So, there you have it, an RFID chair!