Sign in to follow this  
zacaj

Good animated model format

Recommended Posts

zacaj    667
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; }

Share this post


Link to post
Share on other sites
wodinoneeye    1689


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).

Share this post


Link to post
Share on other sites
zacaj    667
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.

Share this post


Link to post
Share on other sites
mrbastard    1577
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.

Share this post


Link to post
Share on other sites
zacaj    667
Is there anyway to to make Milkshape not do that? When I export other formats it doesnt happen(milkshape still says 8)

Share this post


Link to post
Share on other sites
zedz    291
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this