# spline on surface of sphere

Hello, this is something of a math question.

I’d like a spline of some sort that stays on the surface of a sphere, for the lookAt point (view ray) of a camera. This is a little unorthodox.

A spline has the properties that its derivatives in all three dimensions are continuous. I have the additional requirement that its points all satisfy the equation for a sphere, including its control points and its path.

Furthermore, the spline will be indefinitely long in time; its path will be a function of time, and I will continuously add new control points as the prior are exhausted.

Subsequent points will come from a random source, and I’d like to ensure uniform distributability on the sphere. I have some doubts that such an algorithm as:

``````x= random.uniform( -1, 1 )
y= random.uniform( -1, 1 )
z= math.sqrt( 1- x** 2- y** 2 )``````

would satisfy this constraint.

If it would be simpler to do this with HPR’s or R-Phi-Thetas, that’s acceptable too. Also it is not important that I have the equations in this case, or that they be invertible.

why not simply reparent the camera to a dummynode which is at the center of the sphere, and rotate that dummy?.

if you want to go the mathematical way, the points of your spline always have to same distance to the center of sphere. by normalizing and scaling the position vector (relative to the sphere-center) you should be able to get your points quite easily.

I am not sure I understand fully, but this does not sound like it would ensure uniform velocity along the surface of the sphere.