NyArtoolkit with android mode
in
Android Processing
•
7 months ago
Hi all
Can anyone help me to solve build error when implementing NyARToolkit library in Android mode.
For video I used ketai library. It did not work and give me error message like below
BUILD FAILED
C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:881: The following error occurred while executing this line:
C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:883: The following error occurred while executing this line:
C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:895: The following error occurred while executing this line:
C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:290: null returned: 2
Total time: 17 seconds
Can anyone help me?
I tried it with processing 2.0b7 in both Mac and PC.
- import ketai.camera.*;
- import jp.nyatla.nyar4psg.*;
- KetaiCamera cam;
- SingleARTKMarker nya;
- void setup() {
- orientation(LANDSCAPE);
- colorMode(RGB, 100);
- cam = new KetaiCamera(this, 320, 240, 24);//cam=new Capture(this,width,height);
- nya=new SingleARTKMarker(this,640,480,"camera_para.dat");
- nya.setARCodes("patt.hiro",80);
- cam.start();
- }
- void onCameraPreviewEvent()
- {
- cam.read();
- }
- void draw() {
- cam.read();
- nya.drawBackground(cam);
- switch(nya.detect(cam)){
- case SingleARTKMarker.ST_NOMARKER:
- return;
- case SingleARTKMarker.ST_NEWMARKER:
- //println("Marker found.");
- return;
- case SingleARTKMarker.ST_UPDATEMARKER:
- break;
- case SingleARTKMarker.ST_REMOVEMARKER:
- //println("Marker removed.");
- return;
- default:
- return;
- }
- nya.beginTransform();
- {
- setMatrix(nya.getMarkerMatrix());
- drawBox();
- }
- nya.endTransform();
- }
- void drawBox()
- {
- pushMatrix();
- fill(0);
- stroke(255,200,0);
- translate(0,0,20);
- box(40);
- noFill();
- translate(0,0,-20);
- rect(-40,-40,80,80);
- popMatrix();
- }
- void mousePressed()
- {
- if (cam.isStarted())
- {
- cam.stop();
- }
- else
- cam.start();
- }
- void keyPressed() {
- if (key == CODED) {
- if (keyCode == MENU) {
- if (cam.isFlashEnabled())
- cam.disableFlash();
- else
- cam.enableFlash();
- }
- }
- }
3