Quote from: EgonOlsen on October 14, 2011, 07:12:54 AMThanks, it worked.
That's the bounding box. Call calcBoundingBox() on all and it should be fine.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: EgonOlsen on October 14, 2011, 07:12:54 AMThanks, it worked.
That's the bounding box. Call calcBoundingBox() on all and it should be fine.
Object3D obj = objs[k];
obj.build();
Mesh m = obj.getMesh();
m.setSerializeMethod(Mesh.SERIALIZE_VERTICES_ONLY);
System.out.println("- Keyframe "+k+" has "+m.getVertexCount()+" verticies ("+m.getUniqueVertexCount()+" unique).");
m.strip();
m.compress();
meshes[k] = m;
public static Object3D[] loadFile(String path) throws IOException
{
String ext = getExtension(path);
String folder = getFolder(path);
if(ext.equals("3ds"))
{
//System.out.println("Loading 3ds textures");
String[] textures = Loader.readTextureNames3DS(path);
for(String s : textures)
{
if(TextureManager.getInstance().containsTexture(s)) continue;
File f = new File(folder.concat(s).concat(".png"));
if(!f.exists()) { System.err.println("-! Didn't find texture "+s+".png"); continue; }
Texture t = new Texture(new FileInputStream(f));
TextureManager.getInstance().addTexture(s, t);
}
System.out.println("Loading 3ds model: "+path);
return Loader.load3DS(path, 1f);
}
else if(ext.equals("obj"))
return Loader.loadOBJ(path, getNoExtension(path).concat(".mtl"), 1f);
else
throw new IllegalArgumentException("unknown model type: "+path);
}
Page created in 0.018 seconds with 12 queries.