For the admins Please look at the tags.... I have no idea where to put this in math
I also posted this here http://www.gamedev.net/topic/666267-2d-indicator-for-turning-a-spacecraft-in-3d-space/
Maybe you math guys/girls can help me out. I have been trying this for days.
I have this 3D space game and want an indicator (2D arrow in the center of my picture) that points in the direction to turn my ship in 3D space. (Up, down, left, right) so that it always points to the shortest angle to the selected object, regardless whether my ship is facing the object or not.
I have the coordinates of the selected object and the player as well as the angle in which the player is facing. Basicaly;
Vector3 PlayerPos;
Vector3 SelectedPos;
Vector3 PlayerDirectionEuler; or even better Quaternion PlayerDirectionQuaternion;
I have tried so many things, asked and have had so many wrong answers, I can't even remember the 1000 things that didn't work.
The perfect result for me would be a floating point indicating the rotation of my angle in the Z axis.
Please someone give me a hand with this.... It looked so easy when I started but now I am desperate.

I must be missing something, it seems pretty straightforward (which I gather you have heard 1,000 times before) but here goes ...
Lets imagine that the spaceship is surrounded by (inside) a large sphere, which we can lable with a North Pole and lines of longitude (like the earth). If you were to point your spaceship at the North Pole and orient it such that the line of zero longitude (the Greenwich line) is due overhead, then the angle of the arrow will be the same as the objects longitude in that frame of reference. So, for example, if the object in this coordinate system is at longitude 10 degrees and latitude 60 degrees, then the arrow needs to point 10 degrees off vertical. The latitude (with zero at the North Pole and 180 degrees at the South pole) gives something useful you haven't asked for - the distance that must be turned. This would likely be the length of arrow.
To do this, you just have to convert from "world" coordinates to a spaceship co-ordinate system aligned as I have described. This just a rotation in 3D space, so can be described as 3x3 rotation matrix. It transforms the axis of rotation from being the z direction to being the direction the spaceship is travelling, and rotates the view so that the spaceship is aligned so that zero longitude is straight up. You also have to apply the same transformation to the object (so it keeps its relative position). And then, like I said, the direction is just the objects longitude.
There are lots of web pages that describe how to build such a rotation matrix, its pretty straightforward. As you are obviously comfortable with vectors and quaternions, you probably know already. You can do the same thing natively with quaternions (rather than finding the rotation matrix), but matrices are more intuitive (for me) and there's a lot more info on the web about rotation matrices than there is about quaternions.