Created
December 27, 2012 06:19
-
-
Save nappa7878/4385918 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| NyARToolkit for proce55ing/1.0.0 | |
| (c)2008-2011 nyatla | |
| airmail(at)ebony.plala.or.jp | |
| 最も短いARToolKitのコードです。 | |
| Hiroマーカを用意してください。 | |
| This sample program is most small sample as simpleLite. | |
| The marker is "patt.hiro". | |
| GSvideo用に書き換えました | |
| http://www.kisnet.or.jp/nappa/ | |
| */ | |
| //import processing.video.*; | |
| import codeanticode.gsvideo.*; //書き換え | |
| import jp.nyatla.nyar4psg.*; | |
| //Capture cam; | |
| GSCapture cam; //書き換え | |
| MultiMarker nya; | |
| void setup() { | |
| size(640,480,P3D); | |
| colorMode(RGB, 100); | |
| println(MultiMarker.VERSION); | |
| //cam=new Capture(this,640,480); | |
| cam=new GSCapture(this,640,480); //書き換え | |
| nya=new MultiMarker(this,width,height,"camera_para.dat",NyAR4PsgConfig.CONFIG_PSG); | |
| nya.addARMarker("patt.hiro",80); | |
| cam.start(); | |
| } | |
| void draw() | |
| { | |
| if (cam.available() !=true) { | |
| return; | |
| } | |
| cam.read(); | |
| nya.detect(cam); | |
| background(0); | |
| nya.drawBackground(cam);//frustumを考慮した背景描画 | |
| if((!nya.isExistMarker(0))){ | |
| return; | |
| } | |
| nya.beginTransform(0); | |
| fill(0,0,255); | |
| translate(0,0,20); | |
| box(40); | |
| nya.endTransform(); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment