I want a point to be in the same position for an observer. I know how to do it in a 2d coordinate system, when the system is rotated arounf the Z axis. Like this:

I want to achieve this in a 3d coordinate system, but I don't have enough knowledge to understand how to do this, because I have to consider all the 3 axes rotations.
I googled a lot, but can't find any info about this. I will be very grateful for any information.
