Changes between Version 2 and Version 3 of misc/processing/setup_ar
- Timestamp:
- 08/07/14 17:41:28 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
misc/processing/setup_ar
v2 v3 47 47 48 48 Capture cam; 49 MultiMarker nya _jin, nya_poni;49 MultiMarker nya; 50 50 PImage img_jin, img_poni; 51 51 … … 56 56 cam = new Capture(this, cameras[0]); // select cam 0 57 57 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); 62 61 63 62 img_jin = loadImage("data/jin01t.gif"); … … 75 74 background(0); // clear (black) backgound 76 75 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 79 77 80 nya _jin.drawBackground(cam); // draw background camera image81 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); 83 81 scale(0.25); 84 82 rotateX(radians(-90)); 85 83 translate(-200,-400,0); 86 84 image(img_jin, 0, 0); // show Jin 87 nya _jin.endTransform();85 nya.endTransform(); 88 86 } 89 if (nya _poni.isExistMarker(0)) {90 nya _poni.beginTransform(0);87 if (nya.isExistMarker(1)) { 88 nya.beginTransform(1); 91 89 scale(0.25); 92 90 rotateX(radians(-90)); 93 91 translate(-200,-400,0); 94 92 image(img_poni, 0, 0); // show Poni 95 nya_poni.endTransform(); } 93 nya.endTransform(); 94 } 95 96 96 } 97 97 }}} … … 100 100 101 101 102