I can't get a simple texured object to render correctly with OBJloader in OpenGL mode. My OBJ file doesn't specify a MTL (for using procedural textures) and I'm sure the file has Vt, Vn, etc. The result is a correctly shaped object, with with no texture at all.
Any idea what I'm overlooking?
Code:import processing.opengl.*;
import saito.objtools.*;
import saito.objloader.*;
OBJModel model;
PImage tex;
void setup()
{
size(400,400,OPENGL);
colorMode(RGB,1,1,1,1);
model=new OBJModel(this);
model.disableMaterial(); //Tried all combos of these methods
model.enableTexture(); // ""
model.debugMode();
model.load("model.obj");
tex=loadImage("env1.jpg");
model.setTexture(tex); // PImage is definitely loading OK (1024x1024 jpg)
model.setupOPENGL();
model.drawMode(TRIANGLES);
}
void draw()
{
background(.5);
camera(0,0,500,0,0,0,0,1,0);
rotateX(mouseY/100.);
rotateY(mouseX/100.);
scale(100);
model.drawOPENGL(); //Draws proper mesh, untextured
}