1
Support / Re: Animation meshes have 8 more vertices than the main mesh
« on: October 15, 2011, 01:21:00 am »That's the bounding box. Call calcBoundingBox() on all and it should be fine.Thanks, it worked.
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.
That's the bounding box. Call calcBoundingBox() on all and it should be fine.Thanks, it worked.
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);
}
Any help would be appreciated.