Hi,
Has anyone written an easy way to export positions from Processing to After Effects? I'm experimenting with some augmented reality scripts, where a marker's position can be grabbed in 3D, and an object positioned on top of it - e.g. here:
http://vimeo.com/34618110
I've managed to get the matrix positions echoing to the debug window, using printMatrix(); but I'm wondering if there's an easier way to get the movement data into After Effects, and maybe someone has already written some scripts to achieve this?
Many thanks,
Tom
Code is below:
- /**
- 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".
- */
- import processing.video.*;
- import processing.core.*;
- import jp.nyatla.nyar4psg.*;
- import processing.opengl.*;
- import saito.objloader.*;
- OBJModel model;
- Capture cam;
- MultiMarker nya;
- PrintWriter output; // for text logging
- void setup() {
- output = createWriter("log_1.txt");
- frameRate(25);
- size(640,480,P3D);
- colorMode(RGB, 100);
- println(MultiMarker.VERSION);
- cam=new Capture(this,640,480);
- nya=new MultiMarker(this,width,height,"camera_para.dat",NyAR4PsgConfig.CONFIG_PSG);
- nya.addARMarker("patt.hiro",80);
- model = new OBJModel(this, "cassini.obj", "relative", TRIANGLES);
- model.enableDebug();
- model.scale(5);
- //model.translateToCenter();
- }
- void draw()
- {
- if (cam.available() !=true) {
- return;
- }
- cam.read();
- nya.detect(cam);
- background(0);
- lights();
- nya.drawBackground(cam);//frustumを考慮した背景描画
- if((!nya.isExistMarker(0))){
- return;
- }
- nya.beginTransform(0);
- //translate(width/2, height/2, 0);
- for(int i = -1; i < 2; i ++){
- pushMatrix();
- //translate(-1, 1, -1);
- rotateX(radians(270));
- rotateY(radians(0));
- rotateZ(radians(0));
- model.draw();
- printMatrix(); // print value to screen
- popMatrix();
- }
- noFill();
- stroke(255,0,255);
- noStroke();
- // where the print used to be
- nya.endTransform();
- }
- void exit(){
- output.close(); // close log file
- }
1