Hi all,
I’ve been searching the boards, but am at a loss as to how you can have anti-aliased (mipmapped?) textures on .OBJ files (specifically OBJ files exported from Google SketchUp). From what I have found, there are ways to do it if you are specifying a separate Texture (e.g. “TextureManager.loadTexture”), but my textures are being read from a .MTL file automatically by the ObjToJme converter.
To better illustrate my problem, here is a screenshot of how the object looks in SketchUp. The textures are smoothed/filtered (not sure on the term):
Click here for Full screenshot
Here is how the exported .OBJ currently looks in jME:
Click here for Full screenshot
The code I am using is basically the “TestObjJmeWrite” sample:
public class TestObjJmeWrite extends SimpleGame{
public static void main(String[] args) {
TestObjJmeWrite app=new TestObjJmeWrite();
app.setDialogBehaviour(AbstractGame.FIRSTRUN_OR_NOCONFIGFILE_SHOW_PROPS_DIALOG);
app.start();
}
protected void simpleInitGame() {
ObjToJme converter=new ObjToJme();
try {
URL objFile= TestObjJmeWrite.class.getClassLoader().getResource(“data/Test.obj”);
converter.setProperty(“mtllib”,objFile);
converter.setProperty(“texdir”,objFile);
ByteArrayOutputStream BO=new ByteArrayOutputStream();
System.out.println(“Starting to convert .obj to .jme”);
converter.convert(objFile.openStream(),BO);
System.out.println(“Done converting, now watch how fast it loads!”);
long time=System.currentTimeMillis();
Node r=(Node)BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));
System.out.println("Finished loading time is "+(System.currentTimeMillis()-time));
r.setLocalScale(.1f);
rootNode.attachChild(r);
} catch (IOException e) {
e.printStackTrace();
}
}
}
There must be something simple I’m missing :?. Any help would be much appreciated!
