Jump to content
  • Advertisement
Sign in to follow this  
zacaj

Good animated model format

This topic is 3559 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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
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
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!