NyARToolkit + load .3ds + error Cameras: 0 Lights: 0
in
Contributed Library Questions
•
6 months ago
Greetings, I'm using version
processing 1.5 under Ubuntu 12.10 with 64bit with libraries: NyARToolkit, GSVideo.
I import a .3ds with mri3ds library, however when I load it throws the following message: Cameras: 0 Lights: 0 and the screen goes black.
Annex the source code:
//libreria para 3d
import mri.*;
import codeanticode.gsvideo.*;
import jp.nyatla.nyar4psg.*;
import processing.opengl.*;
import javax.media.opengl.*;
GSCapture cam;
V3dsScene vscene;
NyARBoard mark1;
/************************************************************/
void setup() {
size(640,480,OPENGL);
colorMode(RGB, 100);
cam=new GSCapture(this,width,height);
mark1=new NyARBoard(this,width,height, "camera_para.dat", "patt.hiro", 80);
mark1.gsThreshold=120;
mark1.cfThreshold=0.4;
//libreria de 3d
try
{
vscene = new V3dsScene(this,"mono.3ds");//carga el archivo 3ds
vscene.useMaterial( true );//habilita las texturas
} catch( Exception e )
{
println( e );
System.exit( 0 );
}
//fin de libreria 3d
}
/********************************************************************************************/
void draw() {
if (cam.available() !=true) {
return;
}
cam.read();
hint(DISABLE_DEPTH_TEST);
image(cam,0,0);
hint(ENABLE_DEPTH_TEST);
if(mark1.detect(cam)){
PGraphicsOpenGL pgl = (PGraphicsOpenGL) g;
mark1.beginTransform(pgl);
//TRABAJAR AQUI//
/*
//imagen plana
fill(250,0,0);
rect(-25,-25,50,50);*/
/*
//cubo 3d procesing
translate(0,0,30); // trasladar(X,Y,Z)
rotateY(0);
box(40);//box(width/ancho, height/alto, depth/profundidad) o box(size/tamaño)
*/
//objeto 3d exportado
scale(2);
rotateX(-1.5);//posiciona el objeto en vertical
rotateY(0);
rotateZ(-0);
vscene.draw();
mark1.endTransform();
}
}
The .3ds file I'm generating with Blender 2.65. Please your comments and suggestions.
I import a .3ds with mri3ds library, however when I load it throws the following message: Cameras: 0 Lights: 0 and the screen goes black.
Annex the source code:
//libreria para 3d
import mri.*;
import codeanticode.gsvideo.*;
import jp.nyatla.nyar4psg.*;
import processing.opengl.*;
import javax.media.opengl.*;
GSCapture cam;
V3dsScene vscene;
NyARBoard mark1;
/************************************************************/
void setup() {
size(640,480,OPENGL);
colorMode(RGB, 100);
cam=new GSCapture(this,width,height);
mark1=new NyARBoard(this,width,height, "camera_para.dat", "patt.hiro", 80);
mark1.gsThreshold=120;
mark1.cfThreshold=0.4;
//libreria de 3d
try
{
vscene = new V3dsScene(this,"mono.3ds");//carga el archivo 3ds
vscene.useMaterial( true );//habilita las texturas
} catch( Exception e )
{
println( e );
System.exit( 0 );
}
//fin de libreria 3d
}
/********************************************************************************************/
void draw() {
if (cam.available() !=true) {
return;
}
cam.read();
hint(DISABLE_DEPTH_TEST);
image(cam,0,0);
hint(ENABLE_DEPTH_TEST);
if(mark1.detect(cam)){
PGraphicsOpenGL pgl = (PGraphicsOpenGL) g;
mark1.beginTransform(pgl);
//TRABAJAR AQUI//
/*
//imagen plana
fill(250,0,0);
rect(-25,-25,50,50);*/
/*
//cubo 3d procesing
translate(0,0,30); // trasladar(X,Y,Z)
rotateY(0);
box(40);//box(width/ancho, height/alto, depth/profundidad) o box(size/tamaño)
*/
//objeto 3d exportado
scale(2);
rotateX(-1.5);//posiciona el objeto en vertical
rotateY(0);
rotateZ(-0);
vscene.draw();
mark1.endTransform();
}
}
The .3ds file I'm generating with Blender 2.65. Please your comments and suggestions.
1