Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import JMyron.*;
- import processing.opengl.*;
- import pARToolKit.SimpleARToolKit;
- import net.obxlabs.romefeeder.*; //romefeeder..................................................
- import com.sun.syndication.feed.synd.*; //ROME .................................................
- JMyron m;
- PImage img;
- SimpleARToolKit ar;
- int capWidth, capHeight;
- Feeder feeder; // the feeder..............................................
- SyndEntry entry; // feed entry..............................................
- PFont font;//..............................................
- void setup() {
- font = loadFont("Arial-Black-16.vlw");//..............................................
- textFont(font);//..............................................
- size(640, 480, OPENGL);
- capWidth = 320;
- capHeight = 240;
- m = new JMyron();
- m.start(capWidth, capHeight);
- m.findGlobs(0);
- img = createImage(capWidth, capHeight, ARGB);
- ar = new SimpleARToolKit(this, capWidth, capHeight);
- ar.loadPattern("patt.kanji", 80, 0.0f, 0.0f);
- ar.register("showBox");
- stroke(200,200,0);
- //create the feeder
- feeder = new Feeder();
- //set the callback that is called after a feed is loaded
- feeder.setLoadCallback(new FeederCallback() {
- public void event(SyndFeed feed) {
- while(feeder.hasNext()) {
- entry = feeder.next();
- }
- }
- });
- //load the feed
- feeder.load("http://twitter.com/statuses/user_timeline/15967635.rss");
- //clear the background
- //background(0);
- }
- void draw() {
- //background(0);
- if (entry != null){
- println(entry.getTitle());
- String s1=entry.getTitle();
- println(s1.length());
- println(s1.endsWith("http://twitpic.com/20cdl"));
- //noLoop();
- }
- m.update();
- m.imageCopy(img.pixels);
- img.updatePixels();
- hint(DISABLE_DEPTH_TEST);
- image(img,0,0,width,height);
- hint(ENABLE_DEPTH_TEST);
- if (ar.findMatch(img,100)) {
- ar.showObject();
- }
- }
- void showBox(SimpleARToolKit _a) {
- noFill();
- //box(50);
- String s1=entry.getTitle();
- text(s1,10,20);
- fill(255);
- }
Advertisement
Add Comment
Please, Sign In to add comment