I'm starting to feel stupid for not being able to solve this problem, but I can't even find any guide or tutorial on google from someone trying to do the same thing, even though it seems very simple. You guys helped me so good last time , though.. I hope you can help me just one more time.

I have two spheres. One is stable (big yellow sun) and the other a small blue one (planet) that is supposed to orbit the sun. I have a rotate function and I translate the blue one away from the sun center so that it will orbit the sun. I enabled DEPTH_TEST and depending on whether I choose the function DEPTH_FUNC(LEQUAL) or DEPTH_FUNC(LESS), the blue one will constantly appear in front of or behind the yellow one. No matter how I translate or change the rotation it will not do what I want it to. Which is a proper rotation where, if viewed from the front: if for example going from left to right it's behind the yellow one, and from right to left in front of it, so that it's actually orbiting.