Friday, February 22, 2013

Graphics Assignment 6th and 5th part B



This assignment was pretty cool. Exporting the Maya models into the the project in text file was simple as all I did was parsed the code from vertexBuffer and indexBuffer into a txt file. After that the next big task was to convert the text file to binary file. I had to spent several hours to wrap my head around this concept. Doing this in c++ was really tough to grasp. I did a lot of research on Google on how to convert the file. I found some ways of doing it but when I implemented those concept, it didn't work as I was trying to take the entire file and storing it in the buffer with the help of a pointer. Then writing the entire thing to a binary file keeping ios::binary on.


     It took me around 10 hours to finish the 6th assignment.  For writing to binary file, I created a struct similar to s_vertex. I copied all the data from the text file to the struct and then wrote it to the binary file. So, now I have the data in binary file according to the s_vertex structure. In cMesh class, all did is to create a vertexData pointer of struct s_vertex and read the entire data in. Once executed, it worked like a charm.

After this I started my 5th assignment part A. I completed that with in 1 hour and as I am writing this blog its already 5:56 on clock. Time to submit.

No comments:

Post a Comment