obj-loader guidance
in
Contributed Library Questions
•
1 month ago
I found this tutorial video and lib resp for importing .OBJ 3d files into processing environment through these
Then to start with I wrote the following code just to upload a simple 3d .OBJ file (made in
ble
nder's mesh's icosphere
)
( Add->mesh->icosphere.)
then I exported the file into .OBJ format as guided in the video.
Th code is:
- import processing.opengl.*;
- import saito.objloader.*;
- OBJModel model ;
- void setup()
- {
- size(1000, 600, OPENGL);
- //frameRate(30);
- model = new OBJModel(this, "test3.obj");
- //model.enableDebug();
- model.scale(20);
- model.translateToCenter();
- noStroke();
- }
- void draw()
- {
- background(129);
- lights();
- translate(width/2, height/2, 0);
- model.draw();
- }
I just got a gray screen and nothing on it and following in the troubleshoot monitor of processing:
- Loading this = test3.obj
- Loading this = test3.mtl
- java.lang.ArrayIndexOutOfBoundsException: 1
- at saito.objloader.OBJModel.parseMTL(OBJModel.java:993)
- at saito.objloader.OBJModel.parseOBJ(OBJModel.java:813)
- at saito.objloader.OBJModel.load(OBJModel.java:577)
- at saito.objloader.OBJModel.<init>(OBJModel.java:86)
- at obj_test.setup(obj_test.java:32)
- at processing.core.PApplet.handleDraw(Unknown Source)
- at processing.core.PApplet.run(Unknown Source)
- at java.lang.Thread.run(Thread.java:662)
- Obj Name: Icosphere
- java.lang.ArrayIndexOutOfBoundsException: 1
- at saito.objloader.OBJModel.parseOBJ(OBJModel.java:840)
- at saito.objloader.OBJModel.load(OBJModel.java:577)
- at saito.objloader.OBJModel.<init>(OBJModel.java:86)
- at obj_test.setup(obj_test.java:32)
- at processing.core.PApplet.handleDraw(Unknown Source)
- at processing.core.PApplet.run(Unknown Source)
- at java.lang.Thread.run(Thread.java:662)
- V Size: 42
- Vt Size: 0
- Vn Size: 0
- G Size: 1
- S Size: 0
- OBJBoundingBox - Getting the Bounding Box .
In the video I noticed the guy mentioned about syncing the scaling as same in blender environment in the last few seconds as initially he was also facing the same trouble.
I couldn't understand that.
Please help.
1