how to import .3ds file in processing for augmented reality?
in
Contributed Library Questions
•
1 year ago
I m new to processing. By using nyartoolkit, mri3d library, I m trying to import a .3ds model in processing . But everytime i run the program i got the .3ds model just near to marker not on the top of marker. So how can i place the 3d model exact on the marker? while running the program it seems not like a 3d, its just like a shape..
I want the real 3d model on the marker .. but how?
I hv already add the file of pattern(patt.Hiro), camera_para and .3ds model named(Toy1.3ds).
Here is my code:
import processing.opengl.*;
import processing.core.*;
import processing.video.*;
import jp.nyatla.nyar4psg.*;
import mri.*;
V3dsScene vscene;
Capture cam;
MultiMarker nya;
void setup(){
//size(640,480,P3D);
size(1270/2,720/2,OPENGL);
try{
vscene=new V3dsScene(this,"Toy1.3ds");
vscene.useMaterial(true);
}
catch(Exception e){
System.out.println(e);
System.exit(0);
}
colorMode(RGB,100);
println(MultiMarker.VERSION);
cam=new Capture(this,1270/2,720/2);
cam.read();
nya=new MultiMarker(this,width,height,"camera_para.dat",NyAR4PsgConfig.CONFIG_DEFAULT);
nya.addARMarker("patt.hiro",80);
}
void draw(){
if(cam.available()!=true){
return;
}
cam.read();
nya.detect(cam);
background(0);
nya.drawBackground(cam);
if(!(nya.isExistMarker(0))){
return;
}
nya.beginTransform(0);
translate(0,0,20);
vscene.draw();
nya.endTransform();
}
1