VirtualKitten Posted February 6, 2021 Share Posted February 6, 2021 (edited) Hi everyone I wonder if you could help I came across this delighful page which i though might solve all of my problems http://wiki.secondlife.com/wiki/Wanderer only to implement a version of : vector nextCoordinates(integer TYPE) { float driftRange = llFrand(MOVEMENT_RANGE); 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 == 16) return iPos + <driftRange * llCos(a) * llCos(b), driftRange * llCos(a) * llSin(b), driftRange * llSin(c)>; if(TYPE == 32) return iPos + <driftRange * llCos(a) * llCos(b), driftRange * llCos(a) * llSin(b), -driftRange * llSin(c)>; if(TYPE == 64) return iPos + <driftRange * llCos(a) * llCos(b), llFrand(MOVEMENT_RANGE) * llCos(a) * llSin(b), driftRange * llSin(a)>; if(TYPE == 128) return iPos + <driftRange * llCos(a) * llCos(b), llFrand(MOVEMENT_RANGE) * llCos(a) * llSin(b), driftRange * llSin(c)>; if(TYPE == 256) return iPos + <driftRange * llCos(a) * llCos(b), llFrand(MOVEMENT_RANGE) * llCos(a) * llSin(b), -driftRange * llSin(c)>; return iPos; } by the wanderer Does anyone have a neater solution please like llWanderWithin( uses? Thanks for looking Denise Edited February 6, 2021 by VirtualKitten Link to comment Share on other sites More sharing options...
Mollymews Posted February 10, 2021 Share Posted February 10, 2021 On 2/7/2021 at 3:14 AM, VirtualKitten said: Does anyone have a neater solution please like llWanderWithin( uses? given that nextCoordinates is a lookup for different math calculations then the way this code is written is the most efficient. Is not elegant but it is efficient Link to comment Share on other sites More sharing options...
VirtualKitten Posted February 11, 2021 Author Share Posted February 11, 2021 This is what it does really slowelyhttps://gyazo.com/817c0d8023c35918775b125b6154d535 Its going round but flame does not point the same direction i am Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now