Jump to content

VirtualKitten

Resident
  • Posts

    916
  • Joined

  • Last visited

Everything posted by VirtualKitten

  1. oh I see so ,hugs, its not required to keep calling it i didn't understand that tks I will give it a go ad come back with results The TYPE stuff is to add more functionality later as I was using that to control my bat with out bezier curves Changed where liN is 5 b_i starts at 0 vector nextCoordinates(integer p_TYPE) { Debug("nextCoordinates"); if(p_TYPE == 9) { if (b_i == liN || b_i == 0) { b_i = 0; coefisFirst();} iPos = Bez( b_i/liN); newrot = Vec2Rot(dBez( b_i/liN)); b_i++; } llInstantMessage(llGetOwner(),"ipos:"+(string)iPos+", newrot:"+(string)newrot+", TYPE:" +(string)p_TYPE); return iPos; } Here is the results it just spun on the spot but goes up and down a little Here is the dump right from the code its generated from which seems to follow how its moving my model: [05:57] Dragontest: ipos:<228.09280, 27.50462, 3515.72700>, newrot:<-0.36692, -0.60446, 0.20377, 0.67711>, TYPE:9 [05:57] Dragontest: ipos:<228.09280, 27.50462, 3515.72700>, newrot:<-0.36692, -0.60446, 0.20377, 0.67711>, TYPE:9 [05:57] Dragontest: ipos:<228.09280, 27.50462, 3515.72700>, newrot:<-0.36692, -0.60446, 0.20377, 0.67711>, TYPE:9 [05:57] Dragontest: ipos:<228.09280, 27.50462, 3515.72700>, newrot:<-0.36692, -0.60446, 0.20377, 0.67711>, TYPE:9 [05:57] Dragontest: ipos:<228.09300, 27.50420, 3515.72300>, newrot:<0.56870, -0.42021, 0.44150, 0.55234>, TYPE:9 [05:57] Dragontest: ipos:<228.09300, 27.50420, 3515.72300>, newrot:<0.56870, -0.42021, 0.44150, 0.55234>, TYPE:9 [05:57] Dragontest: ipos:<228.09300, 27.50420, 3515.72300>, newrot:<0.56870, -0.42021, 0.44150, 0.55234>, TYPE:9 [05:57] Dragontest: ipos:<228.09300, 27.50420, 3515.72300>, newrot:<0.56870, -0.42021, 0.44150, 0.55234>, TYPE:9 [05:57] Dragontest: ipos:<228.09300, 27.50420, 3515.72300>, newrot:<0.56870, -0.42021, 0.44150, 0.55234>, TYPE:9 [05:57] Dragontest: ipos:<228.09280, 27.50390, 3515.72600>, newrot:<-0.12924, -0.69520, 0.68290, 0.18343>, TYPE:9 [05:57] Dragontest: ipos:<228.09280, 27.50390, 3515.72600>, newrot:<-0.12924, -0.69520, 0.68290, 0.18343>, TYPE:9 [05:57] Dragontest: ipos:<228.09280, 27.50390, 3515.72600>, newrot:<-0.12924, -0.69520, 0.68290, 0.18343>, TYPE:9 [05:57] Dragontest: ipos:<228.09280, 27.50390, 3515.72600>, newrot:<-0.12924, -0.69520, 0.68290, 0.18343>, TYPE:9 Yes, Prof there is a lot of other code that does stuff abt 900 lines but anything with movements comes through these routines that i have shared. Hugs
  2. Prof, I am trying to learn and take your advice, please don't be cross b_i is initialized at 0 is that not correct as i don't understand these Bezier curves . I understand you mean setting 0 will return to original position that would be ok for test . But my model doesn't do that as it slides to the right of its range https://i.gyazo.com/25589190520a33a0e938b846646f43f4.mp4 and then cant produce points inside range.
  3. Hmm , Prof it wont progress, if I do that as the target is required to move on and if not set will stop movement but I have simplified liN to 5 as it was 10 . There was no change I presume you would like a printout of the points it creates to look at I can do that: integer __loadCoordinates(vector l_pos ,vector l_dest,rotation l_rot, float time , integer target) { //Debug("Load Points..."); llInstantMessage(llGetOwner(),"lpos:"+(string)l_pos+", lDest:"+(string)l_dest); etc As you can see ZERO_VECTOR is given as destination which explains why its not moving: [03:42] Dragontest: lpos:<230.52710, 25.94859, 3518.70200>, lDest:<0.00000, 0.00000, 0.00000> However , If I place a message here : vector nextCoordinates(integer TYPE) { if(TYPE == 9) { if (b_i == liN || b_i == 0) b_i = 0; coefisFirst(); iPos = Bez( b_i/liN); newrot = Vec2Rot(dBez( b_i/liN)); b_i++; } llInstantMessage(llGetOwner(),"ipos:"+(string)iPos); return iPos; } I get a constant destination value output which is odd : [03:47] Dragontest: ipos:<230.52710, 25.94859, 3518.70200> [03:48] Dragontest: ipos:<230.52710, 25.94859, 3518.70200> I also noted TYPE was empty 0 and was being reset by my advance reset sorted this and have produced a moving dump : [04:04] Dragontest: ipos:<230.50340, 25.66232, 3518.71200>, newrot:<0.47281, -0.52578, -0.01529, 0.70694>, TYPE:9 [04:04] Dragontest: ipos:<230.47460, 25.69403, 3518.71400>, newrot:<0.57893, -0.40600, 0.70709, 0.00461>, TYPE:9 [04:04] Dragontest: ipos:<230.52010, 25.82897, 3518.70700>, newrot:<-0.70623, 0.03526, -0.69990, -0.10066>, TYPE:9 [04:04] Dragontest: ipos:<231.10010, 25.53748, 3518.66200>, newrot:<-0.61493, 0.34909, -0.68689, 0.16786>, TYPE:9 [04:04] Dragontest: ipos:<230.74100, 25.41944, 3518.69300>, newrot:<-0.25539, -0.65937, -0.60373, 0.36812>, TYPE:9 [04:04] Dragontest: ipos:<230.80220, 24.74232, 3518.70000>, newrot:<0.22823, -0.66926, 0.58474, 0.39759>, TYPE:9 [04:04] Dragontest: ipos:<230.50130, 25.66157, 3518.71000>, newrot:<0.23445, -0.66711, 0.47901, 0.52015>, TYPE:9 [04:04] Dragontest: ipos:<230.49720, 25.65967, 3518.71000>, newrot:<-0.10895, -0.69866, 0.05848, 0.70468>, TYPE:9 [04:04] Dragontest: ipos:<230.47790, 25.63909, 3518.71000>, newrot:<-0.59678, -0.37928, -0.20163, 0.67775>, TYPE:9 [04:04] Dragontest: ipos:<230.48640, 25.54206, 3518.71000>, newrot:<-0.69550, -0.12758, -0.58007, 0.40438>, TYPE:9 [04:04] Dragontest: ipos:<230.93620, 25.53039, 3518.67100>, newrot:<0.54637, -0.44887, 0.16243, 0.68820>, TYPE:9 [04:04] Dragontest: ipos:<230.99770, 25.60481, 3518.66500>, newrot:<-0.69232, 0.14386, -0.67253, -0.21841>, TYPE:9 [04:04] Dragontest: ipos:<230.76730, 25.42241, 3518.68700>, newrot:<-0.26934, -0.65380, -0.07498, 0.70312>, TYPE:9 [04:04] Dragontest: ipos:<230.85560, 24.68674, 3518.69300>, newrot:<0.61351, -0.35157, 0.68005, 0.19373>, TYPE:9 [04:04] Dragontest: ipos:<230.49330, 25.65669, 3518.70700>, newrot:<-0.70486, 0.05635, -0.61196, 0.35427>, TYPE:9 [04:04] Dragontest: ipos:<230.47620, 25.63115, 3518.70800>, newrot:<-0.62165, 0.33697, -0.55264, 0.44112>, TYPE:9 As you can see its pretty haphazard motion I have also noted when I am seated or linked it does not move the object oddly but it moves strangely no bezier route when i am not https://i.gyazo.com/75ed0ccd20bd781c88e128ad338f3d8a.mp4
  4. I tried it vector nextCoordinates(integer TYPE) { Debug("nextCoordinates"); if(TYPE == 9) { if (b_i == liN || b_i == 0) b_i = 0; coefisFirst(); iPos = Bez( b_i/liN); newrot = Vec2Rot(dBez( b_i/liN)); b_i++; } return iPos; } _llWanderWithinKeyframe (vector home, vector range, list c) { pos = llGetPos(); iPos = llGetPos(); list TYPE = [9] ; // ,16,32,64,128,126]; integer vAreaParcelsqm = llList2Integer(llGetParcelDetails(iPos,[PARCEL_DETAILS_AREA]),0); vector area = < vAreaParcelsqm -.25, vAreaParcelsqm -.25,vAreaParcelsqm -.25>; vector bot = my_home-WANDER_RANGE /2.0; vector top = my_home+WANDER_RANGE/2.0; //llInstantMessage(llGetOwner(),"bot:"+(string)bot+"top:"+(string)top); // if(TYPE_COUNT++ > 1) { TYPE_COUNT = 0; TYPE_FLIGHT = (integer)(llFrand(7.0)); iPos = llGetPos();} TYPE_FLIGHT=9; if( TYPE_FLIGHT == 0) {TYPE_FLIGHT == 8; iPos = llGetPos();} integer i = 20; timer_wander = llGetUnixTime(); do { i--; Debug("_llWanderWithinKeyframe:Process point"); nex_pos = clipRegion(bot,top,nextCoordinates(llList2Integer(TYPE,TYPE_FLIGHT) )); } while(checkInside2(bot,top,nex_pos) == FALSE && i>0); if(nex_pos != ZERO_VECTOR && i!=0) { Debug("_llWanderWithinKeyframe: Moving : "+ (string)nex_pos); if(TYPE_FLIGHT != 9) newrot = llGetRot(); target_wander_id = __loadCoordinates(iPos,(vector)(nex_pos-iPos),newrot, llFrand(FUDGE)+ (nex_pos.z)/SPEED,target_wander_id); } } And it was the same no movement it could be lsl having connection problem i will try tomorrow, hugs x
  5. I dont understand why i need to use dbez surely Vec2Rot( Bez( b_i/liN)) will wok?
  6. Hmm still lost to know why it keeps changing its not rotating now lol
  7. Well I comented out my checks for inside Region and Check in Range and it did same thing so it must be the nextposition or wander code doing this code still doing this. I have nothing in this to trap the case the bezier is moves out of range vector nextCoordinates(integer TYPE) { // float driftRange = llFrand(MOVEMENT_RANGE); // float circle_radius = 5.0; // float a = llFrand(TWO_PI); // float b = llFrand(TWO_PI); // float c = llFrand(PI); // if(TYPE == 2) return <iPos.x + driftRange, iPos.y + llFrand(MOVEMENT_RANGE), iPos.z>; //if(TYPE == 4) return <iPos.x + driftRange * llCos(a), iPos.y + driftRange * llSin(b), iPos.z>; // if(TYPE == 8) return iPos + <driftRange * llCos(a) * llCos(b), driftRange * llCos(a) * llSin(b), driftRange * llSin(a)>; if(TYPE == 9) { if (b_i == liN || b_i == 0) {b_i = 0; coefisFirst();} iPos = Bez( b_i/liN); b_i++; } return iPos; }
  8. so would i just use in my get Next Position (9) if(TYPE == 9) { if (b_i == liN || b_i == 0) {b_i = 0; coefisFirst();} return Bez( b_i/liN); b_i++; } So I have if i am right and understand you nextCoordinates(9) will call this over until LiN frames or points and then start a new curve vector nextCoordinates(integer TYPE) { float driftRange = llFrand(MOVEMENT_RANGE); float circle_radius = 5.0; float a = llFrand(TWO_PI); float b = llFrand(TWO_PI); float c = llFrand(PI); // if(TYPE == 2) return <iPos.x + driftRange, iPos.y + llFrand(MOVEMENT_RANGE), iPos.z>; //if(TYPE == 4) return <iPos.x + driftRange * llCos(a), iPos.y + driftRange * llSin(b), iPos.z>; // if(TYPE == 8) return iPos + <driftRange * llCos(a) * llCos(b), driftRange * llCos(a) * llSin(b), driftRange * llSin(a)>; if(TYPE == 9) { if (b_i == liN || b_i == 0) {b_i = 0; coefisFirst();} return Bez( b_i/liN); b_i++; } return iPos; } Now this more or less spins my dragon like other 2,4,8 did I can only guess my region detection or the box range is wrong see video? https://i.gyazo.com/123d8cee8fe8401da3995b820fa0ffc6.mp4 I have the following code and vector WANDER_RANGE = <20.0,20.0,5.0>;: integer checkInside2(vector bottomLeftCorner, vector topRightBack, vector pos) { if (topRightBack == ZERO_VECTOR || bottomLeftCorner == ZERO_VECTOR || pos.x < bottomLeftCorner.x || pos.y < bottomLeftCorner.y || pos.x > topRightBack.x || pos.y > topRightBack.y || pos.z > topRightBack.z ) { return FALSE; // If weare outside area } return TRUE; } vector clipRegion(vector bot, vector top, vector pos) { if (pos.x < bot.x) pos.x = bot.x; else if (pos.x > top.x) pos.x = top.x; if (pos.y < bot.y) pos.y = bot.y; else if (pos.y > top.y) pos.y = top.y; if (pos.z < bot.z) pos.z = bot.z; else if (pos.z > top.z) pos.z = top.z; return pos; } _llWanderWithinKeyframe (vector home, vector range, list c) { pos = llGetPos(); iPos = llGetPos(); rotation newrot = llGetRot(); list TYPE = [2,4,8,9] ; // ,16,32,64,128,126]; integer vAreaParcelsqm = llList2Integer(llGetParcelDetails(iPos,[PARCEL_DETAILS_AREA]),0); vector area = < vAreaParcelsqm -.5, vAreaParcelsqm -.5,vAreaParcelsqm -.5>; vector bot = my_home-WANDER_RANGE /2; vector top = my_home+WANDER_RANGE/2; // llInstantMessage(llGetOwner(),"bot:"+(string)bot+"top:"+(string)top); if(TYPE_COUNT++ > 1) { TYPE_COUNT = 0; TYPE_FLIGHT = (integer)(llFrand(7.0)); iPos = llGetPos();} if( TYPE_FLIGHT == 0) {TYPE_FLIGHT == 8; iPos = llGetPos();} integer i = 20; timer_wander = llGetUnixTime(); do { i--; Debug("_llWanderWithinKeyframe:Process point"); nex_pos = clipRegion(bot,top,nextCoordinates(llList2Integer(TYPE,TYPE_FLIGHT) )); } while(checkInside2(bot,top,nex_pos) == FALSE && i>0); if(nex_pos != ZERO_VECTOR && i!=0) { Debug("_llWanderWithinKeyframe: Moving : "+ (string)nex_pos); if(TYPE_FLIGHT != 9) newrot = llGetRot(); else newrot =Vec2Rot(nex_pos); target_wander_id = __loadCoordinates(iPos,(vector)(nex_pos-iPos),newrot, llFrand(FUDGE)+ (nex_pos.z)/SPEED,target_wander_id); } }
  9. i went back to Doras ode and found this what is the b2 = Bez( i/liN); r2 = Vec2Rot(dBez( i/liN)); in a for frame loop for is b2 = Bez( i/liN); r2 = Vec2Rot(dBez( i/liN)); used to calculate the location of the point to move to ? So I am guessing is Bez( i/liN); my new position and Vec2Rot(dBez( i/liN)) my new rotation If i dont use i in a loop will this impact the first curve Doras snipit KFMlist=[]; coefisFirst(); b1 = Bez(0); r1 = Vec2Rot( dBez(0)); integer i; for ( i=1; i<=frames; i++ ) { b2 = Bez( i/liN); r2 = Vec2Rot(dBez( i/liN)); KFMlist += [ b2-b1, r2/r1, dT]; b1 = b2; r1 = r2; } Am I really looking at a timer event to pack a list of moves that I call from as this seems over memory use using an array
  10. also coefisFirst() { P0 = llGetPos(); Po0 = P0; P3 = randomP(); P2 = randomP(); P1 = randomP(); Po1 = P1; Q1 = 3.0*P1-3.0*P0; Q2 = 3.0*P0-6.0*P1+3.0*P2; Q3 = 3.0*P1-P0+P3-3.0*P2; } doesn't return a vector point
  11. ok so if I understand just need to call if(TYPE == 😎 return coefisFirst() in vector nextCoordinates(integer TYPE) and use 8 to get the curves what does . My dragon has no poseball yet I am trying to figure out the adjacently move thing for particle ball. Its not so easy either. vector Bez( float x ) { return P0 + (Q1 + (Q2 + Q3*x)*x)*x; } vector dBez( float x ) { return Q1 + (2.0*Q2 + 3.0*Q3*x)*x; } vector sBez( float x ) { return 2.0*Q2 + 6.0*Q3*x; } do? this one rotation ? Vec2Rot( vector FWD ) { FWD = llVecNorm( FWD ); vector UP = < 0.0, 0.0, 1.0 >; if ( llFabs(FWD.z) < 1.0 ) LEFT = llVecNorm(UP%FWD); UP = llVecNorm(FWD%LEFT); return refFrame*llAxes2Rot(FWD, LEFT, UP); } so infact are you suggesting I need vector nextpoint = coefisFirst() if(TYPE == 8 )return nextpoint and yet new rotation Vec2Rot(nextpoint)?
  12. Yes but there are three bits of code : first is ok vector randomP() { return llGetPos() + < range.x*(llFrand( 2.0)-1.0), range.y*(llFrand( 2.0)-1.0), range.z*(llFrand( 2.0)-1.0) > * homeRot; } Next not so good idk no list as you suggested what does coefisFirst, coefisNext, coefisLast actually mean ? and how does fit in with other code at bottom i found on net for bezier curves vector P1; vector P2; vector P3; vector Q1; vector Q2; vector Q3; vector randomP() { return llGetPos() + < range.x*(llFrand( 2.0)-1.0), range.y*(llFrand( 2.0)-1.0), range.z*(llFrand( 2.0)-1.0) > * homeRot; } coefisFirst() { P0 = llGetPos(); Po0 = P0; P3 = randomP(); P2 = randomP(); P1 = randomP(); Po1 = P1; Q1 = 3.0*P1-3.0*P0; Q2 = 3.0*P0-6.0*P1+3.0*P2; Q3 = 3.0*P1-P0+P3-3.0*P2; } coefisNext() { P0 = P3; P1 = 2.0*P3-P2; P3 = randomP(); P2 = randomP(); Q1 = 3.0*P1-3.0*P0; Q2 = 3.0*P0-6.0*P1+3.0*P2; Q3 = 3.0*P1-P0+P3-3.0*P2; } coefisLast() { P0 = P3; P1 = 2.0*P3-P2; P2 = 2.0*Po0-Po1; P3 = Po0; Q1 = 3.0*P1-3.0*P0; Q2 = 3.0*P0-6.0*P1+3.0*P2; Q3 = 3.0*P1-P0+P3-3.0*P2; } vector Bez( float x ) { return P0 + (Q1 + (Q2 + Q3*x)*x)*x; } vector dBez( float x ) { return Q1 + (2.0*Q2 + 3.0*Q3*x)*x; } vector sBez( float x ) { return 2.0*Q2 + 6.0*Q3*x; } //Three control point Bezier interpolation //mu ranges from 0 to 1, start to end of the curve // current_mu= i * increment; in i loop, where increment = 1.0 / gNumSegments; vector bezier3(vector p1, vector p2, vector p3, float mu) { float mum1; float mum12; float mu2; vector p; mu2 = mu * mu; mum1 = 1 - mu; mum12 = mum1 * mum1; // p= (1-mu)^2 p1 + 2*mu*(1-mu)*p2 + mu^2 * p3 p.x = p1.x * mum12 + 2. * p2.x * mum1 * mu + p3.x * mu2; p.y = p1.y * mum12 + 2. * p2.y * mum1 * mu + p3.y * mu2; p.z = p1.z * mum12 + 2. * p2.z * mum1 * mu + p3.z * mu2; return(p); } I don't understand why this is not scripted anywhere most of the code online out there doesn't do this at all .
  13. Hmm, is that helpful idk did you see my videos prof ? I have DoCheckMakingProgress(llGetPos()) You seem to suggest i need to write AI this is never going to fit in a script Which is integer DoCheckMakingProgress(vector l) { //Debug("Checking we are moving"); if(LOC == ZERO_VECTOR) LOC = llGetPos(); Tolerances += (llVecDist(l,LOC)); if( llGetListLength(Tolerances) < 10 ) return TRUE; else if((llListStatistics(LIST_STAT_SUM , Tolerances )/10) == llList2Float(Tolerances,0)) { time_unit = llGetUnixTime();LOC = ZERO_VECTOR; Tolerances=[]; return FALSE; } LOC = ZERO_VECTOR; Tolerances=[]; return TRUE; } But it gets stuck not moving so I don't think my points work for next point very well and Doras code is to complicated for little me .
  14. I really wanted Doras thing to do next point like mine as this one doesnt really give good points that flow or keep animal upright https://i.gyazo.com/2afce31b39e9e9e22c1b8150ff4d555f.mp4 oddly my hair flies off too Laughs if i narrow box area on z i.e vector WANDER_RANGE = <15.0,15.0,1.0>; he behaves but doesn't move far https://i.gyazo.com/0d9340e4142f9375836897fdc3719a61.mp4 this is how far I got he seems to get stuck in a get stuck routine as he has not moved of spot.
  15. I should say this works in my bat but gives odd results in my dragon
  16. Hmm not really the answer I needed @Profaitchikenz Haiku thanks but what I said above my procedure returns coordinates and rotation in a list to llSetKeyframedMotion( as described in my post above with next move position this uses two forms . Let me try and explain via my code: vector nextCoordinates(integer TYPE) { float driftRange = llFrand(MOVEMENT_RANGE); float circle_radius = 5.0; float a = llFrand(TWO_PI); float b = llFrand(TWO_PI); float c = llFrand(PI); if(TYPE == 2) return <iPos.x + driftRange, iPos.y + llFrand(MOVEMENT_RANGE), iPos.z>; if(TYPE == 4) return <iPos.x + driftRange * llCos(a), iPos.y + driftRange * llSin(b), iPos.z>; // if(TYPE == 8) return iPos + <driftRange * llCos(a) * llCos(b), driftRange * llCos(a) * llSin(b), driftRange * llSin(a)>; } and integer __loadCoordinates(vector l_pos ,vector l_dest,rotation l_rot, float time , integer target) { time = (float)llVecDist(l_pos,(l_pos+l_dest))/TARGET_AFFINITY; if(time < 0.2) time = .3; lCoordinate = []; lCoordinate +=l_dest; lCoordinate += l_rot; // * any new rot relative to current position. lCoordinate +=time; pos = l_pos+l_dest; vLastRelPos =pos; lastRot = llGetRot(); iStartTimer = TRUE; target = __llTargetRemove(target); return llTarget(pos, 50.0); } _llWanderWithinKeyframe (vector home, vector range, list c) { pos = llGetPos(); iPos = llGetPos(); list TYPE = [ 2,4,8]; //4,8,16,32,64,128,126]; integer vAreaParcelsqm = llList2Integer(llGetParcelDetails(iPos,[PARCEL_DETAILS_AREA]),0); vector area = < vAreaParcelsqm -5, vAreaParcelsqm -5,vAreaParcelsqm -5>; vector bot = my_home-WANDER_RANGE /2; vector top = my_home+WANDER_RANGE/2; // llInstantMessage(llGetOwner(),"bot:"+(string)bot+"top:"+(string)top); if(TYPE_COUNT++ > 1) { TYPE_COUNT = 0; TYPE_FLIGHT = (integer)(llFrand(7.0)); iPos = llGetPos();} if( TYPE_FLIGHT == 0) {TYPE_FLIGHT == 8; iPos = llGetPos();} integer i = 20; timer_wander = llGetUnixTime(); do { i--; nex_pos = clipRegion(bot,top,nextCoordinates(llList2Integer(TYPE,TYPE_FLIGHT) )); } while(checkInside2(bot,top,nex_pos) == FALSE && i>0); if(nex_pos != ZERO_VECTOR && i!=0) { //Debug("_llWanderWithinKeyframe: Moving : "+ (string)nex_pos); target_wander_id = __loadCoordinates(iPos,(vector)(nex_pos-iPos),NormRot(llGetRot()), llFrand(FUDGE)+ (nex_pos.z)/SPEED,target_wander_id); } } Called from above I did this so I could change animations and possible move a particle ball with LLSetLinkPrimitiveParamsFast( I was trying to Understand Dora's bezier movement code so it would get next points in this way as an option in nextCoordinates() does this make more sense? I was hopeful Dora's Bezier method would make better flight pattern which it does by loading everything into a KFM array I think bt this is doe though a menu and I want a random flight path.
  17. @Profaitchikenz Haiku thanks for your reply about placing object keys in a list. I presume this cant be added to llSetKeyframedMotion as it has no option to specify keys and acts on the object its in I am curious how you are doing this in KFM my animesh will move me if i am seated on it however. I need a particle ball or saddle to keep pace . I don't really understand this bezier code stuff and how it can be implemented into my next coordinate proc point and rotation plotter to give smooth movement in an animalistic flight pattern. I did notice you said use LLSetLinkPrimitiveParamsFast but not sure how stable it will be if its sending out particle fire to a position at same time I am sorry i dont understand this can you help? D x
  18. @Profaitchikenz Haiku. Thanks for you reply. My test of Dora's code in a box was ok until i touched the box it shot of in course that i could not stp i did not see kill script so pressed new curve and it crashed not surprisingly. Yes the idea of KFM in this example is bad practice as you cant change animations and it kills itself as you suggested if its over 144 entries i have to wonder why its on wiki and not replaced with something better X D .
  19. Animats if this is so easy to understand why is there three loop events in examples above
  20. Thanks for reminding me @Animats yes the list dump to keyframe is not a good move this is why I went to load next point so I could always change animation during event. i expected to find some examples of this only but found this wiki page which crashes dumping KeyFrame events . What i was hoping for clarification why it required three loops?
  21. Thanks @QuistTessa I did think about this but still have much misunderstanding i.e that is to say my existing routine splutters out new points that are within a clipped region, that uses vector points I am presuming from what you suggested I need Catmull rom to create my new extra points my creature will transverse. But am unsure . If I have P1 and P2 and P3 p4 e.g I get nextcoordinates which randomly uses three types of movement from float driftRange = llFrand(MOVEMENT_RANGE); float circle_radius = 5.0; float a = llFrand(TWO_PI); float b = llFrand(TWO_PI); float c = llFrand(PI); where iPos is my new point using randomly either : return <iPos.x + driftRange, iPos.y + llFrand(MOVEMENT_RANGE), iPos.z>; OR return <iPos.x + driftRange * llCos(a), iPos.y + driftRange * llSin(b), iPos.z>; OR return iPos + <driftRange * llCos(a) * llCos(b), driftRange * llCos(a) * llSin(b), driftRange * llSin(a)>; iPos is generated in vectors how can these be used to generate new points does your example do this ? Do I have to specify how many new points i need? Or is this what this bezier toy script does Thank you hugs Dx
  22. Hi @Canuck, hope you are well , I am trying to work out how to get a new position from a random Bezier route inside an area or box frame bottom top vector positions. I think the script above does its work in this bit : if ( message == "New" ) { homeRot = llGetRot(); float liN = (float)frames; float dT = Tmotion/liN/(float)curvNumb; dT = llRound(45.0*dT)/45.0; if ( dT < 0.11111111 ) dT = 0.11111111; KFMlist=[]; coefisFirst(); b1 = Bez(0); r1 = Vec2Rot( dBez(0)); integer i; for ( i=1; i<=frames; i++ ) { b2 = Bez( i/liN); r2 = Vec2Rot(dBez( i/liN)); KFMlist += [ b2-b1, r2/r1, dT]; b1 = b2; r1 = r2; } integer j = curvNumb; while ( j-- > 2 ) { coefisNext(); for ( i=1; i<=frames; i++ ) { b2 = Bez( i/liN); r2 = Vec2Rot(dBez( i/liN)); KFMlist += [ b2-b1, r2/r1, dT]; b1 = b2; r1 = r2; } } coefisLast(); for ( i=1; i<=frames; i++ ) { b2 = Bez( i/liN); r2 = Vec2Rot(dBez( i/liN)); KFMlist += [ b2-b1, r2/r1, dT]; b1 = b2; r1 = r2; } } But all I know what its doing is creating entries in a list to be fed to a KFM . I wanted to create this output singerly as a feed but also inside my frame limits of movements vector bottom_left and vector top_right_bak. This math's is a bit over my head as it uses be higher mathematics than am used to now. What I don't understand is why there is three routines acting on the keyframe. These look all the same but it uses CurveNumb to store the number of curves in the KFM. Why dos it need three ? It also looks like Cofis create three types of different curves with random elements. It still does not explain why it needs three loops unless I am missing something which is possible . Does it have three as it needs a start and finish it can join to which are known quantities, where as he middle is somewhat random? Hugs D X
  23. The last one was better than anything else that I have seen it shot about using up to 16 curves but is kludge using KFM_LOOP. I really wanted to have a call procedure that would be returned from a convoluting series of Bezier curves of a size vector position in a box frame that could be expanded easily though parameters like WIDTH=<15,15,5> its sounds dreadfully complicated to me .
  24. Hi I am confused by al of this but found this on web it was from a script to create a rez-able object along a bezier code . But its not really an answer on how to move a animesh along a path that looks realistic . Does anyone have any experience with this of can give some starting points on how to learn this I know Catmull Rom is used by animation studios but the wiki page on interpolation is really bad ..http://wiki.secondlife.com/wiki/Interpolation and even looks unfinished or elsewhere . I would welcome any test code or ideas please as my creatures are al known as lumpy , lol as they have no graceful movements. Can you help , thanks for looking. //mu ranges from 0 to 1, start to end of the curve // current_mu= i * increment; in i loop, where increment = 1.0 / gNumSegments; vector bezier3(vector p1, vector p2, vector p3, float mu) { float mum1; float mum12; float mu2; vector p; mu2 = mu * mu; mum1 = 1 - mu; mum12 = mum1 * mum1; // p= (1-mu)^2 p1 + 2*mu*(1-mu)*p2 + mu^2 * p3 p.x = p1.x * mum12 + 2. * p2.x * mum1 * mu + p3.x * mu2; p.y = p1.y * mum12 + 2. * p2.y * mum1 * mu + p3.y * mu2; p.z = p1.z * mum12 + 2. * p2.z * mum1 * mu + p3.z * mu2; return(p); } I also found this which was a bit better http://wiki.secondlife.com/wiki/User:Dora_Gustafson/bezier_toy But still not sewing together the bezier curves into a flight path
×
×
  • Create New...