Friday, February 8, 2013

Game Graphics Assignment 4


this assignment took a large amount of time, but was not too difficult. I make may own file format every few weeks it seems, so that was simple. I had already been separating out my code into classes so all i had to do was add in a new class for each part of this assignment.

I was deciding between having a manager class for each of the new types of things. then i could either pass those around or make them all singletons. That way when the material file was loading it could tell the effect manager to load an effect that the material just read. However i decided to instead keep all of the class instances in the scene class and have the scene class be the one that calls load for each object.
So the entity class has its load function called. that function opens up and parses the file. It then returns the names of the mesh and material that it uses. The scene file then will look to see if that mesh has been loaded, if it hasn't then it creates a new Mesh instance and calls the load (giving it the filename).
So each class object has its own information and the name of the other objects it needs. So when i draw i ask for each objects information. The entity returns its world transform and the name of the mesh and material it uses. The scene the looks the mesh up and calls for its information, which returns the vertex buffer offset and index buffer offset.

Everything should be working, as long as i didn't miss something.

To move the camera use w, a, s, d
To move the light use the numpad:
numpad 8: up
numpad 2: down
numpad 4: left
numpad 6: right
numpad 7: in (-Z)
numpad 9: out (+Z)

here is a screenshot of the depth buffer in pix

No comments:

Post a Comment