I have a sphere with a radius of .5
The sphere is centred at 0,0,0
I am now trying to place items around my sphere based on a given x,y,z on the surface of the sphere.
My items have been draw/created in such a way that they are positioned on the surface when translated to 0,0,0 because their centre offset has been positioned at the centre of the sphere.
What I need is some help with the calculation needed to get the correct glRotate values so that my icons will show at the correct x,y,z on the surface.
To help explain what I mean, here is a picture:
So you can see 0,0,0 at the centre, and also rotating around the same point is the blue line, This represents the rotation of my object. The green part is the visible part of my item, and so will draw on the surface of the sphere.
I have everything ready to go for this, in that I can already draw my items in this manner, however I am not able to correctly calculate the rotation.
With the default rotation of Identity my items will draw on the bottom of the sphere.
In summary I am looking for something like this:
glRotate = GetRotationForSurface(X,Y,Z);
I hope that's clear, this is a bit tricky to explain.