3D Paddles in OpenGL

We are back with more OpenGL this time using C++. After getting an idea of how basic OpenGL systems worked with OpenTK and C# I wanted to try it out in C++. So I decided to make 3D version of pong.

Mesh Loader

Using Tiny Obj Loader I set up a mesh loading system that supported some basic features like multi material meshes. Having this allowed me to easily assign multiple materials to the paddles and ball for a more unique look.

Collision and physics

I first created some simple AABB collision with overlap detection abilities. Then with that, I set up a physics loop that ran at a set speed to allow for more consistent simulation results.

Under the hood

Of course, there’s more stuff that’s harder to show in the context of just pong, for example:

  • Shaders loading from files.

  • Originally this project was planned to go further so I also have a world system that allows for easier management of game objects.

  • A game_object base class with included transform, that is managed by the world system, and all game objects to inherit from.

Previous
Previous

Unnamed Space Game

Next
Next

OpenGL via OpenTK