How to use 3D Saito OBJLoader to load a 3D model

edited May 2017 in Library Questions

I got a F-22 3d model with its .mtl file and .png (texture) files. I used several 3d viewers like Microsoft 3D Builder, Open 3D Model Viewer etc. to open it, it works fine. But I used Saito OBJLoader to load it into Processing, it either just showed a shape or a black shape with some bars. The code is simple like "standard" ( you can find them in Processing examples on lost of web page): `import saito.objloader.*;

OBJModel model;

float rotX;

float rotY;

void setup() {

size(1000, 1000, P3D);

model = new OBJModel(this, "FA-22.obj", "relative", TRIANGLES);

model.enableTexture();

model.enableDebug();

model.scale(30);

noStroke();

}

void draw() {

background(87,97,227);

lights();

fill(255,0,255);

pushMatrix();

translate(width/2, height/2, 0);

rotateX(rotY);

rotateY(rotX);

model.draw();

popMatrix();

}

void mouseDragged() {

rotX += (mouseX - pmouseX) * 0.01;

rotY -= (mouseY - pmouseY) * 0.01;

}`

Anyone with Saito OBJLoader experience could give a help? ( I would like to send all files to you by email)

Answers

  • Write the makers of the lib

    Try another lib

  • edited May 2017

    I guess the obj file did not meet the correct praser settings like triangulation.

    Fixed(i guess, without confirmation) through blender import /reexport.

    https://ibb.co/e6YGAk

Sign In or Register to comment.