# How can make an object orbit a sphere in a random direction?

How can I move an object on a random orbital path around a sphere?

I've created some objects at an initial position that is essentially a random point on the sphere offset by some distance (say, 10.0).

Now I want to choose a random direction and have the object orbit the sphere in that direction. How can I accomplish that?

First generate a random 3D rotation matrix. Then for each frame compute a simple, boring rotation vector around the center (e.g x = r*cos(k*t), y = r*sin(k*t), z = 0), multiply it by the rotation matrix, add it to the center of the sphere, and you have a random orbit.