I finally fixed the issue I was having with getting the camera walking over the terrain. I ‘think’ the error was that I wasn’t translating onto the x-z plane at the beginning of my GetHeight(float x, float x) function properly. I said ‘think’ because I redid all of my functions that got the height of the terrain. Sometimes its best to start over again instead of continuously trying to re-edit something that doesn’t work. It’s a relief finally getting this fixed, as I have wasted a lot of time trying to get this to work.
In addition I managed to add a zombie into my engine by doing this untidily within one class. I am now trying to implement this the proper way to ensure that it is easier to add other assets to the engine. However I am currently having problems constructing my WorldObject class (that manages all objects within the world; i.e. their position, orientation) and my ResourceManager class (checks to see if a mesh or texture has already been loaded, to stop it from being loaded again when these resources are used on multiple objects for example).
As you can see I have added a texture to my terrain. All that was required at the time for this to work was one simple line.
D3DXCreateTextureFromFile(gd3dDevice, "grass.jpg", &mTexture);
Within my time of frustration trying to get the camera to walk over the terrain I cleaned up a lot of the code and removed unnecessary parts of my engine. This should make it easier for me to implement future additions.