top of page
  • Writer's pictureLewis Marlow

Favourite Module 2nd Year Uni

MATHS - 91/100 overall

The project scored 86. It had some funky stuff in the shader, an implementation of the phong reflection model and the maths library obviously had to be my own. I put in Gravity, physics, lighting, collisions; calculating a sphere, calculating the direction of normals. I tried really hard to put as many features in as I could, but because of that; I didn't have enough time left for analysis and reflection.

I know I got a 91 overall but I wanted this project to get as close to 100 as possible. 86 is lower than my API project that got a 93 so... Poop.

The brief suggests using Unity but it felt weird to have a whole render pipeline being calculated on the CPU and then having the exact same thing happen on the shader. It only took a couple hours to put a concept together. Here's the concept

So instead I set out to see if I could put the whole process together in OpenGL in a C++ project. It turned into the biggest and most rewarding project I've done and I do not regret it one bit.

The hardest part came with design and led to using smart pointers for the first time. I also finally implemented the dependency inversion principle and I did it without realising. Physics, transforms and collision classes work together, but how do you get them to work together without creating include loops?

The maths class is used everywhere, even in the shader class, and it's low level it does't need anything. However, classes like physics and transform kinda need each other to talk to one another; but you can't include them in each other because they'll loop includes. To be honest, I don't know why it doesn't work, it just doesn't.

So to fix this you have an object class that includes them both, with functions that pass information between them that they both need, and with smart pointers, we can create safety nets so that if there's not a physics class attached to the object, we can stop that communication.

I don't even know if that's related to the dependency inversion principle, but it makes the object class and classes like it, more modular and loosely coupled; and that's the definition of the dependency inversion principle.

I got no points for creating this design but I really wanted a better understanding of how to create one. This had absolutely nothing to do with the brief but gave me the perfect opportunity to try.

There is in no way that I regret doing it the way I did. Why should I? I still got well over a first and I learned so much.

This is why this project is my favourite. It's the highlight of my learning, and I don't want to be done with it.

I'll keep expanding and refactoring to learn more about maths and design.

25 views0 comments

Recent Posts

See All

Finished University with a first class degree

Well that was hard work. I think the proof is that there hasn't been a blog post in a long time. I submitted my final piece of work on the 14th of June. 10 days after my Birthday and 1 day before my a


bottom of page