Alhexx' Capsule BAC Format Description 1.0 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= This file format seems to be a quite simple one. There's a very simple header with only 16 Bytes, with an ID of 4 Bytes at the beginning. After that, there's an 32Bit Integer telling you how much Vertices there are stored in this model. Then comes the Vertices Pool with this format: Type Length Function ---------------------------------------- Integer 4 Bytes ID of Vertex Float 4 Bytes X Coord Float 4 Bytes Y Coord Float 4 Bytes Z Coord In other word, the vertices have an ID, followed by the XYZ Coords. After the Vertices Pool is finished, the Group Pool starts. First, there's an 16Bit Integer telling you the Number of Groups. What follows is the Group Pool itself. Every single Group is variable-sized! They're Build up like this: Type Length Function ---------------------------------------- Integer 2 Bytes ID ??? NullString Variable Specifies the Group Name - 36 Bytes unknown, probably Bones ? Integer 2 Bytes Number of Polygons - Variable Polygons Data The Polygons Data is interesting. Every Polygon is stored as an 16Bit Integer and read out from the Polygon Pool. And last but not least, there's the Polygon Pool at the end. First, as always, there's a 16Bit Integer telling you the number of entries here... Then an array of Data follows, each entry is 26 Bytes long: Type Length Function ---------------------------------------- Integer 2 Bytes Tag (always = 0xFFFF) Integer 2 Bytes Vertex 1 Integer 2 Bytes Tex-X 1 Integer 2 Bytes Tex-Y 1 Integer 2 Bytes Vertex 2 Integer 2 Bytes Tex-X 2 Integer 2 Bytes Tex-Y 2 Integer 2 Bytes Vertex 3 Integer 2 Bytes Tex-X 3 Integer 2 Bytes Tex-Y 3 Integer 2 Bytes Vertex 4 Integer 2 Bytes Tex-X 4 Integer 2 Bytes Tex-Y 4 The Tex-? things are the Texture Coords for that Vertex. You should know that the Polygons aren't Triangles; they're Quads. So, if you want to use the model in normal modellers, you'll have to convert this Polygons into Triangles. Here's an example: (You should use a fixed-size font for this...) 1 2 1 2 +---------+ +---------+ | | |\. TRI 1 | | | | '\. | | QUAD 1 | | '\. | | | | '\. | | | | TRI 2 '\| +---------+ +---------+ 4 3 4 3 So, if the Quad uses the Vertices 1 to 4, you can create 2 Triangles: One with the Vertices 1, 2, 3 and one 1, 3, 4. You see, there's a problem with the Polys. Usually, the Tex Coords are stored in the Vertices, however, it this case, one Vertex can have multiple Tex Coords if it is used by several Polygons. (That's one of the main reasons whay the MS3D JILL Capsule Importer is still beta...) You will have to create a lot of technical procedures to get a good solution for this problem. Of course, you can create 4 Vertices for every single Polygon, but that would end in a huge amount of vertices... so good luck! I'll see if I can program a useful solution in my Importer. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= I know this was a kinda short description, but I think it contains everything you need to build a viewer/converter. ~~ Greetings Fly Out To: ~~ Darkness Ficedula Kaddy #17 Kaoru S. Night Mirex Phaeron Qhimm Sephiroth 3D ShinRa Inc. The SaiNt ... and everyone I've forgotten! Visit or contact me: -------------------- Home : http://www.alhexx.com Forum : http://forums.alhexx.com Mail : alhexx@alhexx.com - Alhexx 16:37 2002-11-16