Contrary to what I said earlier, I meant disable GL_DEPTH_TEST.
Basically what happens is this. In most 3D engines, everything, regardless of drawing order, gets drawn in 3D space, as in, when something is supposed to be in front of something, it will be drawn in front of it, even if that object is drawn later.
However, if GL_DEPTH_TEST is disabled, or any equivalent of that, it doesn't take into account the depth of said object, it will always draw the object on top regardless. OpenGL has built-in functions for it, the easiest is disabling the depth test.
All thanks to Minecraft modding.
EDIT: It still moves in a 3D plane though, even if depth test is disabled. As in, it moves as normal, only always drawn on top.
Basically what happens is this. In most 3D engines, everything, regardless of drawing order, gets drawn in 3D space, as in, when something is supposed to be in front of something, it will be drawn in front of it, even if that object is drawn later.
However, if GL_DEPTH_TEST is disabled, or any equivalent of that, it doesn't take into account the depth of said object, it will always draw the object on top regardless. OpenGL has built-in functions for it, the easiest is disabling the depth test.
All thanks to Minecraft modding.
EDIT: It still moves in a 3D plane though, even if depth test is disabled. As in, it moves as normal, only always drawn on top.