Sunday, February 10, 2013

Graphics Write-Up #4

This assignment was brutal.  In the end I logged a total of 15 hours on it.  10 of those hours were trivial file parsing code, which was incredibly dull and boring.  The other 5 hours were at least more interesting.

Setting up the light color and intensity was very easy.  I implemented this first before doing anything else so I could see if it was working.  I also did the depth buffer at this point, although I obviously was unable to test it with a single cube.  Once I had the file parsing working, I then had to figure out how to change the code so that multiple objects could be drawn instead of just one.

This was probably the most interesting part of the assignment since I had to really go through all of the code and understand exactly what it was doing.  The code changes really weren't that bad though.  Instead of using a single m_scene object I just made an array of them and looped as necessary.  Initially all I did was wrap the Update, Load, and Release in for loops based on the number of entities in the scene, but this just resulted in a black screen.  

After a bunch of struggling and use of PIX, Sherly helped a bunch by telling me that parts of Update could only be called once, which obviously makes sense.  So I took out the clearing, BeginScene, and EndScene and I finally had three cubes working.

The end result is awesome.  Now all we have to do to add more objects to the scene is change/add files and the program *should* do the rest of it.




No comments:

Post a Comment