Animation meshes have 8 more vertices than the main mesh

Started by Colonel Thirty Two, October 14, 2011, 02:15:20 AM

Previous topic - Next topic

Colonel Thirty Two

I'm making a command line tool to create serialized objects for jPCT-AE, and I am running into some problems with the animation meshes. They always have 8 more vertices than the mesh than the file I am using for the base. I've tried a variety of models, but the animation mesh is always 8 more.

Mesh code:
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;


Model loading code: (happens with both obj and 3ds formats)
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.

EgonOlsen

That's the bounding box. Call calcBoundingBox() on all and it should be fine.

Colonel Thirty Two

Quote from: EgonOlsen on October 14, 2011, 07:12:54 AM
That's the bounding box. Call calcBoundingBox() on all and it should be fine.
Thanks, it worked.