The aim for this piece of coursework was to create a 3D scene using the Direct3D API. The specification for the project included making use of the programmable pipeline for rendering, loading “.X” models, and creating effects such as shadows or reflection using the stencil buffer. My project created a 3D gallery for viewing various simple shaders applied to a central statue model.
My original intention was to create a platform and graphics API agnostic framework on which to build the application, however much of the work on this proved to be outwith the scope and timeframe of the project. Whilst the application was still created sucessfully, a lot of its functionality relies directly on a DirectX device rather than an interface which might have allowed the DirectX code to be substituted in future.
However, I did learn a lot from this project:
- There’s no point creating a graphics API independant framework when the task at hand specifically relies on one API.
- Designing the application functionality before you design the codebase is probably easier than building a generic framework and creating something on top of it.
- If you don’t know what the solution involves, you also don’t know what you can exclude. This leads to a bulk and functionality you may not even need.
- Abstracting functionality and creating interfaces to an API isn’t difficult. But it is time consuming.
- Reusable code doesn’t necessarily mean creating a whole application you can start with each time. Just writing solid, loosely couple code will make it easy to use in a different application in future.
- Specialising each element of the framework and planning it seperately (eg graphics, input, audio) is design level premature optimisation. If the task at hand really is creating a framework or engine, keep everything modular by favouring composition over inheritance.
- Specify common interfaces for objects to make programming easier, not just when it’s necessary for polymorphism.
- Above all, K.I.S.S.
So I guess I can’t say this project was a giant success, although I am happy with the application I finished with. However, I would say it was necessary – I’m a better programmer because of it.
Controls
Use the WASD keys to control the camera. The Escape key quits the application.
Files
- Download the executable.
- Download and modify the source code and visual studio project.
- View and comment on the video on YouTube.

