This is an 3D Projection and rotation using matrix math.
I made that when i finaly understand how projection and rotation work, i learn it here https://www.youtube.com/watch?v=p4Iz0XJY-Qk