@Dora - thank you so much for your function - I learnt a lot from it - especially about KeyFrames as I never knew they existed.
I put a your function in a simple script that I found on web and it works really smoothly.
// LSL script to rotate an orbiting object// If the rotating object is two linked spheres, the result// can resemble lunar motion around a planet (depending on// timer settings and network performance, etc.).vector rotationCenter;rotation Z_15;integer count;KeyFramedOmega( vector axis, float spinrate){ llSetKeyframedMotion( [], []); if ( spinrate ) { float v = TWO_PI/3.142; if ( spinrate < 0 ) v = -v; list L = [llAxisAngle2Rot( axis/llGetRot(), v), v/spinrate]; llSetKeyframedMotion( L+L+L, [KFM_DATA, KFM_ROTATION, KFM_MODE, KFM_LOOP]); }}default{ state_entry() { llSetTimerEvent( 0.025 ); vector startPoint = llGetPos(); rotationCenter = startPoint + < 0.25,0.25,0.25 >; Z_15 = llEuler2Rot( < 0, 0, 30 * DEG_TO_RAD > ); } touch_start(integer total_number ) { count=0; //llTargetOmega( < 0, 1, 1 >, .2 * PI, 1.0 ); KeyFramedOmega( < 0, 1, 1 >, 1.0 ); } timer() { count=count+1; if (count<100) { vector currentPosition = llGetPos(); vector currentOffset = currentPosition - rotationCenter; // rotate the offset vector in the X-Y plane around the // distant point of rotation. vector rotatedOffset = currentOffset * Z_15; vector newPosition = rotationCenter + rotatedOffset; llSetPos( newPosition ); } }}