Good animated model format

Started by
4 comments, last by zedz 15 years, 5 months ago
I was wondering if anyone had a recommendation for a good animated 3D format... I cant find any lists of good formats, and the only ones ive found by searching arent very good(3DS, MD2,etc) Specifically Im looking for one thats easy to use with vertex arrays. I looked into writing my own format, but when I started writing an exporter for Milkshape, and had it export a cube its somehow making it have 20 vertices, even after the export when i do model info in milkshape, and I registered on the milkshape forums 4 days ago and I havent been approved yet, so I cant ask them. So on an alternate answer, whats wrong with this code? int CPlugin::Execute(msModel *pModel) { FILE *fp; fp=fopen("C:\\model.z3d","w"); int vertexcount,facecount,framecount,normcount; msMesh *mesh; mesh=msModel_GetMeshAt(pModel,0); vertexcount=msMesh_GetVertexCount(mesh); facecount=msMesh_GetTriangleCount(mesh); normcount=msMesh_GetVertexNormalCount(mesh); framecount=msModel_GetMeshCount(pModel); fprintf(fp,"vertices %i\nfaces %i\nnormals %i\nframes %i\nFaces:\n",vertexcount,facecount,normcount,framecount); fclose(fp); return 0; }
Advertisement


Hmm probably should have had 24 (6x4) vertices unless there was no bottom facet.

Each face has 4 points and so that each could have its own texture, UVs (and normals?) they duplicate them (even though they have the same coordinat points).
--------------------------------------------[size="1"]Ratings are Opinion, not Fact
My cube is made of triangles, but shouldnt it have 8 vertices because theres 8 corners? Before I export it it says theres 8 in milkshape.
As wodinoneeye said, the vertices are being duplicated. This is usual.

Current graphics APIs only allow a single normal, colour, and set of texture coordinates per vertex - one of each vertex attribute per vertex.

Your milkshape cube has 8 corners, but each of those corners has more than one set of tex coords - one for each cube face it is part of. This may be difficult to visualise at first, so imagine (or draw) an unwrapped cube. Imagine setting the tex coords so they are right for the top face. But wait! Other faces share vertices with the top face, and they need the tex coords to be different.

Hope that makes sense. If not, draw it and it'll quickly become clear.
[size="1"]
Is there anyway to to make Milkshape not do that? When I export other formats it doesnt happen(milkshape still says 8)
24 verts is normal
to have 8 verts whilst it will be cube shaped it will not look like a cube but more like a sphere due to the shading.
but in saying that u should be able to make Milkshape export only 8 verts (though ive never used the application so personally have no idea)
perhaps remove all shading info from the model, ie no texture coords, no normals etc just export the vertex positions

This topic is closed to new replies.

Advertisement