Regarding the FBX Converter, I (as the rest of the class) used a program provided by the SDK as my starting point. Basically this program goes through the internal structure of the FBX file, exploring its components and printing them out to a console window in an easy-to-understand way.
So, in order to get my first functional draft of the converter I just commented all the calls to functions that were printing stuff that I didn’t require. In the end, for this assignment all I need is Vertex information (position, color, normal and UV) and Texture data. Therefore, I ended just using a couple of functions from the original program, DisplayPolygons(KFbxMesh* pMesh) and DisplayTexture(KFbxGeometry* pGeometry), that provide me with all the stuff I require.
The first function (DisplayPolygons) goes through the list of polygons that form the whole mesh, showing all the information I need, so instead of printing it to the console, I am storing the info in a Vertex structure I created and pushing all those vertices into a STL Vector. After all the polygons are covered, I download all this data to a file using my File System from last quarter (I still cannot believe that it worked so flawlessly). I call this file format D3M, which stands for Diego’s 3D Model, sexy or what?
The second function (DisplayTexture) gives me the path to load the corresponding texture for the model. For the time being I am just uploading the texture manually in the engine and binding it to the model. The next step should be to actually store the texture data inside the D3M file, so I can load the complete model in one shot. Will see how that goes when I try it.
In regards to the Engine, well I just modified it to integrate my File System in it and be able to read/interpret the data inside the D3M file. So, as people usually say “a picture is worth a thousand words”, let the pictures speak for myself instead. Here is what I have right now:
Front View |
Diagonal View from behind |
You have no idea (or maybe you do?) how much joy I felt when I got the first model rendered. Right now I am so proud of my little baby engine, making its first steps to become a grown-up boy.
So, for the time being I will say bye, but I will be back soon with more updates. Stay tuned!
Adios!
No comments:
Post a Comment