saito obj loader - processing.org does not read my .obj
in
Contributed Library Questions
•
1 year ago
The code I wrote has a problem. When I try to load "cello.obj" into OPENGL or P3D, It says:
cello.obj
cello.mtl
objloader version 015
16 April 2009
local tex:
on
draw mode:
POLYGON
IT DOES NOT GIVE an error message, but does not read the object ("cello.obj") either! I WANT it to say this:
"Loaded OBJ from file '/Users/Caroline/Documents/Processing/MIJN PROGRAMMA/vogelobj/data/cello.obj'
4568 vertices.
5586 normals.
2811 textures coordinates"
Help will be very much appreciated.
My Code:
- import processing.opengl.*;
- import saito.objloader.*;
- OBJModel obj;
- void setup(){
- size(900, 900,P3D);//can use OPENGL too
- background(0);
- lights();
- translate(0,0,0);
- obj = new OBJModel(this,"cello.obj");
- obj.debugMode();
- // enableLocalTexture is usefull if you're modeling package uses absolute paths when pointing to the diffuse testure (like XSI)
- // see mtl file in data folder for example
- obj.enableLocalTexture();
- //setting the draw mode
- // model.drawMode(TRIANGLES);
- obj.drawMode(POLYGON);
- //print( screenY(500,500,500));
- }
- void draw(){
- translate(0,0,0);
- obj.draw();
- }
1