Jump to content

Macie Forzane

Resident
  • Posts

    4
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thank you for checking it for me and finding the bug i introduced that could have caught out others reading the script. About the 3.142, I was messing about and thought it might have been an approxiamtion for Pi - not realising it was 3 frames for a full circle I still don't understand all this and was trying to make it run faster - hence the fast timer - now the 3 frames for a full circle makes sense. I'll experiment with this tomorrow and look at the parameters more closely.
  2. thank you for your link and info - it saved me wading through a lot of info to get the script working
  3. @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 ); } }}
  4. Hi, i'm very new to scripting and having a real problem with rotations. I thought it would be easy to make a 2 piece object where prim 2 orbits prims 1(the root) - basically like a moon orbiting a planet. However, it seems more complicated because i need the rotations to be done server side and not client side, so that anyone viewing it will see the same result. It seems the objects have to be physical and llTargetOmega won't work, is this true ? Is this orbiting possible, and if so any suggestions would be welcome. Thank you, Macie
×
×
  • Create New...