Obj = $sphere01 - Nombre del objeto (si tu esfera no se llama así) cámbialo.
Timeres = 1f - Resolución de tiempo.
Fn getrot te =
(.
If t<=0f then return quat 0 0 0 1 - T=0 => no rotación.
T0 = t-timeres.
T1 = te - Tiempo actual.
Rot0 = getrot(t0) - Rotación previa.
P0 = at time t0 (*.obj), position - Posición previa.
P1 = at time t1 (*.obj), position - Posición actual.
If(p0==p1) then return rot0.
Dif = p1-p0 - Diferencia en posición.
Len = length(dif) - Distancia que viaja.
Vec = dif / leen - Normalizar Vector de movimiento.
R0 = at time t0 (*.obj), Radius - Radio anterior.
R1 = at time t1 (*.obj), Radius - Radio actual.
Rotax = cross Vec [0, 0, 1] - Eje de rotación.
Angle = 360*len/((r0+r1)*pi) - Monto de rotación.
Rotdif = quat angle rotax - Rotación desde t0 a t1.
Rot1 = rot0 + rotdif - Rotación total).
Getrot(currenttime).