Код:
time=time*2;
float N = N1;
float id=id1;
float mr=0-r;
float lat=id/N*180-90+id/N*pi*2+time;
float lg = id/N*360-180+id/N*pi*2+time;
float x = (r+id/N*rh) * cos(lat)*cos(lg);
float y = (r+id/N*rh)*cos(lat)*sin(lg);
float z = (r+id/N*rh) * sin(lat);
pos.x=x;
pos.y=y;
pos.z=z-r/2;
float3 vel = float3(0,0,0);
vel =normalize(TP-inpos)*5;
if (length(inpos-TP)<(450+time))
{
pos= inpos + vel;
}