Monday, April 25, 2011

Here is the story of how this two dudes met: the FBX Converter and Diego's 3D Model!

Hello you all! I am back from a weekend of intense work, code tuning and wrapping things together for milestone submission. That’s right! Yesterday I submitted the first milestone for my updated Graphics Engine including the first version of the FBX Converter.

Let’s get down to business. I will use this post to talk about the final details of the FBX Converter and the File Format used to store the models. Since I previously talked about the logic behind the FBX Converter, and taking into account that it has not changed, I will proceed to explain how the program can be used. The syntax for using it is the following:

                FBX_Converter.exe infile.fbx outfile.d3m [options]

There are two (2) possible options or arguments that can be passed to the program:

                -notexture
                -addtexture texture.tga

The first option simply omits any texture contained inside the FBX file, so the converter only extracts vertex and triangle data. The second option tells the converter to use an external texture instead of the one contained inside the FBX, therefore the final model file contains the texture supplied by the user.

Regarding the File Format (Diego’s 3D Model), it is composed of three big chunks of data (Vertices, Triangle Indices and Texture) accompanied by their respective type-specific headers and chunk headers.

At the beginning of the file is the File Header, which contains descriptive information for reading the rest of it like the number of Chunks and total size. Next are the Chunk Headers: these specify the size of each chunk and its respective type, this way the engine is able to interpret the data back.

Finally we have all the actual data needed for rendering the model. First we have the Vertex Array with its respective header which specifies the number vertices and the individual size of each one (this is used for the Vertex Buffer Objects calls). Next we have the Triangle Indices Array, and once again in the header we have the total number of triangles and the size of each one. At last we have the Texture with its header containing the dimensions (width and height), number of colors per pixel (depth), size of texture data array and two (2) values that are necessary for rendering the texture in OpenGL (format and components).

There you have it! I will be back really soon, probably later tonight or tomorrow at the latest, with a video of my updated Graphics Engine.

Adios!

No comments:

Post a Comment