SwireD Posted November 3, 2019 Share Posted November 3, 2019 (edited) Hello! a friend of mine asked me a puzzle. How to make the object rotate or move along a certain path (circle)? there will be several such objects (dancepads - one script for each pad...), but the main problem - they cannot be linked to anything! I read somewhere that it is possible to specify the coordinates and the object will move from point to point. how to do it and is there any other way? As example - solar system. Edited November 4, 2019 by SwireD Link to comment Share on other sites More sharing options...
Rolig Loon Posted November 4, 2019 Share Posted November 4, 2019 Study llSetKeyframedMotion. There are several examples in the LSL wiki. 1 1 Link to comment Share on other sites More sharing options...
SwireD Posted November 4, 2019 Author Share Posted November 4, 2019 (edited) 12 hours ago, Rolig Loon said: Study llSetKeyframedMotion. There are several examples in the LSL wiki. Thank you very much! I managed to create such a script. works almost - after passing the entire circle, the object stops at one point for 3 seconds. How to avoid it? and also if I add on/off toggle then after stop/start the path breaks and the objects begin to move along a different trajectory. Is it possible to keep the path? and the only way to get all the platforms to rotate along one trajectory for me was possible only by placing all the platforms at one point and adding a llSleep() for each subsequent platform with magnification. default { state_entry() { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); llSetKeyframedMotion([<0,0,0>, 3, <1.5,3.5,0>, 3, <3.5,1.5,0>, 3, <3.5,-1.5,0>, 3, <1.5,-3.5,0>, 3, <-1.5,-3.5,0>, 3, <-3.5,-1.5,0>, 3, <-3.5,1.5,0>, 3, <-1.5,3.5,0>, 3 ], [KFM_DATA, KFM_TRANSLATION, KFM_MODE, KFM_LOOP]); } } Edited November 4, 2019 by SwireD Link to comment Share on other sites More sharing options...
Rolig Loon Posted November 4, 2019 Share Posted November 4, 2019 There is quite a lot to KFM. You have only begun to explore its possibilities. I suggest spending some time reading and then experimenting with the KFM_MODE option to see what it has to offer. 1 Link to comment Share on other sites More sharing options...
animats Posted November 4, 2019 Share Posted November 4, 2019 9 hours ago, SwireD said: Thank you very much! I managed to create such a script. works almost - after passing the entire circle, the object stops at one point for 3 seconds. How to avoid it? and also if I add on/off toggle then after stop/start the path breaks and the objects begin to move along a different trajectory. Is it possible to keep the path? and the only way to get all the platforms to rotate along one trajectory for me was possible only by placing all the platforms at one point and adding a llSleep() for each subsequent platform with magnification. default { state_entry() { llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); llSetKeyframedMotion([<0,0,0>, 3, <1.5,3.5,0>, 3, <3.5,1.5,0>, 3, <3.5,-1.5,0>, 3, <1.5,-3.5,0>, 3, <-1.5,-3.5,0>, 3, <-3.5,-1.5,0>, 3, <-3.5,1.5,0>, 3, <-1.5,3.5,0>, 3 ], [KFM_DATA, KFM_TRANSLATION, KFM_MODE, KFM_LOOP]); } } That looks incorrect. The list for keyframed motion is "relative position, relative rotation, time delay" by default. If you want position only, you have to provide KFM_DATA, KFM_TRANSLATION in the modes. And the PRIM_PHYSICS_SHAPE_TYPE info is obsolete; that was for pre-mesh viewers. It stops at the end for 3 seconds because you told it to stop at the end for 3 seconds. Change that last time to 0.100 second. KFM_LOOP is kind of interesting. It doesn't just do all the steps again. It instantaneously moves the object back to the starting position and runs the steps again. This has its uses; I use it in my escalators. 1 Link to comment Share on other sites More sharing options...
Qie Niangao Posted November 4, 2019 Share Posted November 4, 2019 (edited) 53 minutes ago, animats said: And the PRIM_PHYSICS_SHAPE_TYPE info is obsolete; that was for pre-mesh viewers. Pretty sure this is still necessary to get KFM to work if the object is made of prims without anything (such as a Materials-bearing face) forcing them to Mesh LI accounting. [EDIT: Now that I scroll the code to the end, I think the KFM_DATA, KFM_TRANSLATION is in the options list as required; KFM_MODE is just another component of the options list. The stopping for 3 seconds is indeed in the data list, but it's the "<0,0,0>" bit at the beginning which happens again when KFM_LOOP returns to the start of the data list.] Edited November 4, 2019 by Qie Niangao 1 Link to comment Share on other sites More sharing options...
Rolig Loon Posted November 4, 2019 Share Posted November 4, 2019 5 minutes ago, Qie Niangao said: 55 minutes ago, animats said: And the PRIM_PHYSICS_SHAPE_TYPE info is obsolete; that was for pre-mesh viewers. Pretty sure this is still necessary to get KFM to work if the object is made of prims without anything (such as a Materials-bearing face) forcing them to Mesh LI accounting. Yes. And in any case, it can't hurt. At worst, it's redundant if the item is already set to CONVEX_HULL. 2 Link to comment Share on other sites More sharing options...
SwireD Posted November 5, 2019 Author Share Posted November 5, 2019 (edited) Hi! Works much better! Thank you all! I had to use different coords for each platform. default { state_entry() { llListen(10, "", "", ""); } listen(integer chan, string name, key id, string msg) { if (msg == "stop") { llSetKeyframedMotion([], [KFM_COMMAND, KFM_CMD_PAUSE]); } else if (msg == "start") { llSetKeyframedMotion([], [KFM_COMMAND, KFM_CMD_PLAY]); llSetKeyframedMotion([ < 3.5, -1.5, 0 > , 3, < 1.5, -3.5, 0 > , 3, < -1.5, -3.5, 0 > , 3, < -3.5, -1.5, 0 > , 3, < -3.5, 1.5, 0 > , 3, < -1.5, 3.5, 0 > , 3, < 1.5, 3.5, 0 > , 3, < 3.5, 1.5, 0 > , 3], [KFM_DATA, KFM_TRANSLATION, KFM_MODE, KFM_LOOP]); } } } Edited November 5, 2019 by SwireD 2 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