Develop and Download Open Source Software

Browse Subversion Repository

Contents of /nyar4psg/trunk/examples/simpleLite/simpleLite.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: 954 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 最も短いARToolKitのコードです。
7 Hiroマーカを用意してください。
8
9 This sample program is most small sample as simpleLite.
10 The marker is "patt.hiro".
11 */
12 import processing.video.*;
13 import jp.nyatla.nyar4psg.*;
14
15 Capture cam;
16 MultiMarker nya;
17
18 void setup() {
19 size(640,480,P3D);
20 colorMode(RGB, 100);
21 println(MultiMarker.VERSION);
22 cam=new Capture(this,640,480);
23 nya=new MultiMarker(this,width,height,"camera_para.dat",NyAR4PsgConfig.CONFIG_PSG);
24 nya.addARMarker("patt.hiro",80);
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 if((!nya.isExistMarker(0))){
38 return;
39 }
40 nya.beginTransform(0);
41 fill(0,0,255);
42 translate(0,0,20);
43 box(40);
44 nya.endTransform();
45 }
46
47

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