I’ve not posted on here for a couple of months and although this may look like one of those “oh sorry I’ve been away, I’m back” kind of posts, let me assure you that yeah, it actually is.
The reason for being is that since resuming uni and starting back in the second year, the intense workload has left me feeling like we hit the ground running without much of a respite and while this year’s material has been the most useful in terms of learning specific programming techniques, the material we’ve covered so far hasn’t been very ‘blog friendly’ unlike the project pieces I constructed in the first year.
Instead this year we’ve been covering 3 major topics; advanced physics techniques, 3D lighting calculations in OpenGL and programming in C++ (a step up from the programming in C the previous year).
Although there is nothing much to show yet for the physics side of things, I have been working on producing 3D shapes within OpenGL and C++ and then lighting the scene (we have been working on manual 3D lighting calculations but thankfully OpenGL handles a lot of this for us).
My OpenGL Clock
Creating primitive objects within OpenGL requires a little work as 3D objects have to be defined using lists of vertices (co-ordinates) within 3D space. Using these points, OpenGL can then apply triangular polygons to make up the surface of the object; the surface direction then relies on a surface normal vector which is perpendicular to the vectors that made up the surface. A correct surface normal allows accurate lighting calculations to be applied to the surface.
After constructing my clock face, I decided to go a step further and add some ‘fake’ shadowing to give the object a little more depth. I say fake shadowing as the shadows seen in the picture are just 2 more iterations of the objects used to generate the hands of the clock, with a darker material applied and then offset just above the surface of the face object. I’m pretty certain term 2 should introduce us to the concept of shader effects to allow for more realistic shadowing but for now my method and a few blending effects have done the trick.


can u give me ur source code?
When I get a spare moment I’ll look for it and post it up (if I can find it)