PDA

View Full Version : Using .c Files Exported By 3D Computer Animation



webprogrammer101
09-23-2001, 03:00 PM
I have created an object in a 3D Program called Anim8or. Anim8or is a very very simple program, doesn't do much other than create 3D objects. One of their nice features, though, is the .C file exporter. It exports the entire object to a .c file containing a few numeric variable arrays. The variables hold ALL of the inforation to create the object.
They are:

mesh01_coords[] (Coordinates)
mesh01_normals[] (Normals)
mesh01_indices[] (Indices)
mesh01_matindices[] (Material Indices)
mesh01_texcoords[] (texture Coordinates)

I was able to load the points of the object from the mesh01_coords[] varialble, but can't figure out how to get the faces to work.

Can anyone please help me out?

Thanks,
Paul

Gavin
09-24-2001, 01:36 AM
So you understand the file format then? If not you will need to find this out, I assume its like VRML so check out how vrml works.

harsman
09-24-2001, 04:06 AM
I'd guess that the mesh01_indices variable holds indices of triangles. So it has numberOfTriangles*3 entries, and each triplet references the vertex data arrays for that triangle except material stuff, which has it's own indices. Try it with a simple model consisting only of triangles and see if the number of indices and number of vertices match up.
<edit>
btw, remember you can only use a single index for all vertex attributes in OpenGL, so you have to duplicate a vertex if it has to have different attributes per face.
</edit>

[This message has been edited by harsman (edited 09-24-2001).]