Hello,
I devlopped some time ago a small java program using the leapmotion libraries and it was working just fine but now for no apparent reason the program doesn't recognize the controller so i recoded it from scratch but it's still isn't working and from the exception I made (ConnectionException) it isn't connected and also the service is not connected.
so here is my java code for the initialisation of the controller. tks for the help
public TheLeap() throws ConnectionException{
fenêtre = new Fenêtre(1400, 1080);
this.setTitle("Leap Motion");
this.setSize(1400, 1080);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setContentPane(fenêtre);
this.setVisible(true);
Controller leapMotion = new Controller();
if(!leapMotion.isConnected()){
System.out.println(leapMotion.isConnected());
System.out.println(leapMotion.isServiceConnected());
throw new ConnectionException();
}
while(true){
InteractionBox iBox2 = leapMotion.frame().interactionBox();
PointableList pointables = leapMotion.frame().pointables();
for(Pointable pointable : pointables){
normalizedPosition = iBox2.normalizePoint(pointable.stabilizedTipPosition());
int x = (int)(normalizedPosition.getX() * width);
int y = (int)(600 - normalizedPosition.getY() * height);
int z = (int)(normalizedPosition.getZ() * 100);
fenêtre.setPosition(new Doigt(x, y, z));
}
fenêtre.repaint();
try{
Thread.currentThread().sleep(20);
}catch(Exception e){
e.printStackTrace();
}
}
}