Changes between Version 2 and Version 3 of misc/processing/setup_ar


Ignore:
Timestamp:
08/07/14 17:41:28 (11 years ago)
Author:
Takashi Obina
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • misc/processing/setup_ar

    v2 v3  
    4747
    4848Capture cam;
    49 MultiMarker nya_jin, nya_poni;
     49MultiMarker nya;
    5050PImage img_jin, img_poni;
    5151
     
    5656  cam = new Capture(this, cameras[0]); // select cam 0
    5757
    58   nya_jin = new MultiMarker(this,width,height,"camera_para.dat",NyAR4PsgConfig.CONFIG_PSG);
    59   nya_jin.addARMarker("patt.hiro", 80);
    60   nya_poni = new MultiMarker(this,width,height,"camera_para.dat",NyAR4PsgConfig.CONFIG_PSG);
    61   nya_poni.addARMarker("patt.kanji", 80); 
     58  nya = new MultiMarker(this,width,height,"camera_para.dat",NyAR4PsgConfig.CONFIG_PSG);
     59  nya.addARMarker("patt.hiro", 80);
     60  nya.addARMarker("patt.kanji", 80); 
    6261 
    6362  img_jin  = loadImage("data/jin01t.gif");
     
    7574  background(0);        // clear (black) backgound
    7675  cam.read();           // read camera image
    77   nya_jin.detect(cam);  // detect marker
    78   nya_poni.detect(cam); // detect marker
     76  nya.detect(cam);  // detect marker
    7977 
    80   nya_jin.drawBackground(cam); // draw background camera image
    81   if (nya_jin.isExistMarker(0)) {
    82     nya_jin.beginTransform(0);
     78  nya.drawBackground(cam); // draw background camera image
     79  if (nya.isExistMarker(0)) {
     80    nya.beginTransform(0);
    8381    scale(0.25);
    8482    rotateX(radians(-90));
    8583    translate(-200,-400,0);
    8684    image(img_jin, 0, 0);     // show Jin
    87     nya_jin.endTransform();
     85    nya.endTransform();
    8886  }
    89   if (nya_poni.isExistMarker(0)) {
    90     nya_poni.beginTransform(0);
     87  if (nya.isExistMarker(1)) {
     88    nya.beginTransform(1);
    9189    scale(0.25);
    9290    rotateX(radians(-90));
    9391    translate(-200,-400,0);
    9492    image(img_poni, 0, 0);     // show Poni
    95     nya_poni.endTransform();  }
     93    nya.endTransform(); 
     94  }
     95 
    9696}
    9797}}}
     
    100100
    101101
    102