Develop and Download Open Source Software

Browse Subversion Repository

Contents of /nyar4psg/trunk/examples/multiMarker/multiMarker.pde

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1158 - (show annotations) (download)
Tue Jan 6 07:38:11 2015 UTC (9 years, 2 months ago) by nyatla
File size: 1091 byte(s)
パッケージ構成をProcessing2.0向けに更新

1 /**
2 NyARToolkit for proce55ing/1.0.0
3 (c)2008-2011 nyatla
4 airmail(at)ebony.plala.or.jp
5
6 複数のARマーカを扱う例です。Hiroマーカと、Kanjiマーカを用意して下さい。
7
8 This sample proglam handles 2 ARToolKit marker.
9 The markers are "patt.hiro" and "patt.kanji"
10 */
11 import processing.video.*;
12 import jp.nyatla.nyar4psg.*;
13
14 Capture cam;
15 MultiMarker nya;
16
17 void setup() {
18 size(640,480,P3D);
19 colorMode(RGB, 100);
20 println(MultiMarker.VERSION);
21 cam=new Capture(this,640,480);
22 nya=new MultiMarker(this,width,height,"camera_para.dat",NyAR4PsgConfig.CONFIG_PSG);
23 nya.addARMarker("patt.hiro",80);//id=0
24 nya.addARMarker("patt.kanji",80);//id=1
25 cam.start();
26 }
27
28 void draw()
29 {
30 if (cam.available() !=true) {
31 return;
32 }
33 cam.read();
34 nya.detect(cam);
35 background(0);
36 nya.drawBackground(cam);//frustumを考慮した背景描画
37 for(int i=0;i<2;i++){
38 if((!nya.isExistMarker(i))){
39 continue;
40 }
41 nya.beginTransform(i);
42 fill(0,100*(i%2),100*((i+1)%2));
43 translate(0,0,20);
44 box(40);
45 nya.endTransform();
46 }
47 }
48
49

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26