thank you very much, everybody!
>DGS3
your trouble is now "Bluetooth failed to initialize", isn't it?
i don't know your "rocketfish stack".
what message on your text pain of P5?
when you run your sketch, it will say like "BlueCove version 2.0.3 on mac".
would you try WiiremoteJ v1.6 (newest) ?
the following forum may be useful.
http://www.wiili.org/forum/wiiremotej-f68.html
>ALJ
your setting is seemed to be good.
your trouble likes my one on my ppc mac, osx 10.5.5.
now the success probability of my trial is growed up with
Processing 1.0.3 + WiiremoteJ v1.6
would you try above newest combination ?
btw, i don't have any experience of linux, but i can say there is no needto rename BlueCove-gpl's name.
above link to wiili.org includes tips on linux.
things about blueZ/BlueCove-gpl, please ask to bluecove forum, sorry.
http://groups.google.com/group/bluecove-users
>TM
thank you for your offer.
can you try the following codes on your mac, if you have two or more remotes?
this sktch is an intermediate code to detect 3D position of an IR-Pen with 2 motes.
Quote:import lll.l4P5.*;
import lll.wrj4P5.*;
import lll.Loc.*;
PGraphics bg;
Wrj4P5 wii;
Remote r1,r2;
Rod lay1,lay2;
Loc rl1=new Loc(.5,.5,-1);
Loc rl2=new Loc(.1,.5,-1);
void setup() {
size(400, 300, P3D);
bg = createGraphics(400,300,P2D);
l4p5.setup(this);
wii = new Wrj4P5(this);
wii.connect(2,Wrj4P5.EX,false);
r1 = new Remote(wii.rimokon(0), new Loc(0,10,100));
r2 = new Remote(wii.rimokon(1), new Loc(0,200,100));
frameRate(20);
}
public void draw() {
if (wii.isConnecting()) return;
// 2D drawing with ir information from 2 remotes
// background(0);
background(irView(bg,wii));
// 3D drawing, the real world
translate(400,150,0);
lights();
camera(600.0,600.0,600.0, -300.0,-300.0,-300.0, 0.0,0.0,-1.0);
stroke(128,0,0);line(0,0,0,300,0,0);
stroke(0,128,0);line(0,0,0,0,300,0);
stroke(0,0,128);line(0,0,0,0,0,300);
// draw remotes
stroke(255);
l4p5.line(r1.keel()); l4p5.line(r2.keel());
// view beams of each remotes
lay1 = r1.irViewDir(0);
lay2 = r2.irViewDir(0);
stroke(64);
if (lay1!=null) l4p5.line(lay1.stern(),lay1.at(10000));
if (lay2!=null) l4p5.line(lay2.stern(),lay2.at(10000));
// now get the crossing point
noStroke();
if (lay1!=null&&lay2!=null) {
Rod cross = lay1.nearest(lay2);
l4p5.line(cross);
l4p5.sphere(cross.at(cross.length()/2),8);
}
//
}
PGraphics irView(PGraphics bg, Wrj4P5 wii) {
// 2D drawing with ir information from 2 remotes
bg.beginDraw();
bg.background(0);
bg.scale(1,-1);
bg.translate(0,-height);
drawIRDot(0, bg, wii.rimokon(0).irLights[0] );
drawIRDot(1, bg, wii.rimokon(1).irLights[0] );
bg.endDraw();
return bg;
}
void drawIRDot(int bx, PGraphics g, Loc ir) {
color c = color(32+32*(bx),32+32*(1-bx),32);
g.noFill();g.stroke(c);g.strokeWeight(1);
g.rect(bx*width/2+5,5,width/2-10,height/2-10);
if (ir.x<0) return;
c = color(96+32*(bx),96+32*(1-bx),96);
g.noStroke();g.fill(c);
g.ellipse((bx+ir.x)*width/2, ir.y*height/2,8,8);
}