I got my camera controlled by the mouse. Now I want a sphere to be always in the center of my view(just for testing). I tried that by assigning the sine of the Y rotation of the camera times 10 as the X coordinate and the same for the Y coordinate but with cosine:
SphereX = 10 * math.sin(YRotation)
SphereY = 10 * math.cos(YRotation)
But now I would like to know how to set the Z position. I can set the proper height of the sphere by doing that:
SphereZ = 10 * math.sin(XRotation)
But the problem is, that the sphere is only moving up and down and the moving towards the camera is ignored. How can I fix that?