I think part of the problem is the viewer uses an object attribute "AngularVelocity", which, in the case of non-physical prims/linksets, is entirely a viewer side effect. The simulator doesn't know how a given non-physical object appears to be oriented at any given time so trying to rotate it in a visually meaningful way isn't really possible without jumping through hoops. The object orientation is a separate property than angular velocity and they don't usually update together.
Here's a script that attempts to mix llTargetOmega together with llSetRot. It's not perfect as it relies on several external factors which may not be well controlled in many installations, such as simulator system load, timer accuracy, script event queue, minimal network lag, and minimal viewer renderer lag, among other things. However it should give an idea of what can be possible under good conditions. Note that I've only tried it in SL and on XEngine and I don't know if it will work on YEngine. // Interpolation between rotations with llTargetOmega example // Dahlia Trimble // 6/14/2013 list gRotKeys = []; integer gRKIndex = 0; integer gRKStride = 1; ProcessNextKeyframe() { rotation r1 = llList2Rot(gRotKeys, gRKIndex); gRKIndex += gRKStride; llSay(0, "Key: rot:" + (string)r1); if (llGetListLength(gRotKeys) <= gRKIndex) { llSetTimerEvent(0); llTargetOmega(<0, 0, 1>, 0, 0); } else { rotation r2 = llList2Rot(gRotKeys, gRKIndex); float time = llAngleBetween(r1, r2) / PI * 2.0; // 90 degrees/second rotation dR = r2 / r1; vector axis = llRot2Axis(dR) * llRot2Angle(dR); axis *= r1; vector angularVelocity = axis / time; llSetTimerEvent(time); llTargetOmega(angularVelocity, 1, 1); } llSetRot(r1); } default { state_entry() { llSay(0, "Script running"); // make some keyframes... gRotKeys += ZERO_ROTATION; gRotKeys += llEuler2Rot(<130, 15, 90> * DEG_TO_RAD); gRotKeys += llEuler2Rot(<74, 186, 223> * DEG_TO_RAD); gRotKeys += llEuler2Rot(<45, 60, 90> * DEG_TO_RAD); gRotKeys += ZERO_ROTATION; } touch_start(integer total_number) { if (llGetListLength(gRotKeys) < gRKStride * 2) return; gRKIndex = 0; ProcessNextKeyframe(); } timer() { ProcessNextKeyframe(); } } On Sat, Aug 1, 2020 at 3:08 PM Leal Duarte <ajldua...@sapo.pt> wrote: > Manual will "be strange" if the prim is already doing target omega. > > not immediate clear what is the real rotation viewer applies to the > actual prim (as seen by region) > > also not clear what is the base rotation it will use if gets a new > target omega. > > your original code will make the cylinder rotate around its local Z > axis, it you do stop target omega before changing the prim rotation and > setting other target omega. > > Ubit > > > > On 01-Aug-20 20:53, Jeff Kelley wrote: > > At 10:18 PM -0700 7/31/20, Dahlia Trimble wrote: > > > >> A single prim is essentially a linkset of one prim. > > > > Ok. So this sentence applies : > > > > « If the script is attached to the root prim, the > > entire object rotates around the region axis. » > > > > I was wrong saying it rotates around the prim's axis. It rotates > > around the region axis llRot2Up( llGetRot() ) (and not llGetLocalRot, > > thanks Fred) which come to be the prim's up axis expressed in region > > coordinates. So > > > > llTargetOmega( llRot2Up( llGetRot() ), 1, 1) > > > > should make the prim rotate around it's z axis once issued. > > > > This is not the case when the prim's orientation has been altered > > manually while spinning. > > > > Let's try another way : > > > > Can someone come with a llTargetOmega script making a cylinder rotate > > around it's z axis, using any event to restore the effect after the > > prim's orientation has been altered manually while spinning ? > > > > > > > > -- Jeff > > > > _______________________________________________ > > Opensim-users mailing list > > Opensim-users@opensimulator.org > > http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-users > _______________________________________________ > Opensim-users mailing list > Opensim-users@opensimulator.org > http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-users > _______________________________________________ Opensim-users mailing list Opensim-users@opensimulator.org http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-users