My implementation of Exercise 5.1 of Millington I. (2010). Game physics engine development: How to build a robust commercial-grade physics engine for your game (2nd ed.). CRC Press.
Written in C23, using my "blob" game engine (GLFW + OpenGL 3.3 + FreeType).
P.S.: I partially mixed up this exercise with exercise 5.3 (reverse gravity generator) in my head. The implementation of this exersice would still be the same, but it would make more sense to render the generator area under the cubes so that it looks like it "uplifts" them, rather than the tractor beam-ish way that I have rendered it in this video, which makes it look like the cubes are "pulled" upwards instead.
Ещё видео!