These forums are CLOSED. Please visit the new forums HERE
Local rotation in llSetPrimitiveParams? |
|
|
Vinnie Baxter
Registered User
Join date: 5 Feb 2007
Posts: 17
|
03-03-2008 15:29
Why isn't there a possibility of local rotation in the llSetPrimitiveParams? Is this a sensible feature request or am I missing a simple way to achieve this?
|
|
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
|
03-03-2008 16:37
from wiki llSetLocalRot:
Q: How do I perform this with llSetPrimitiveParams on a child of an attached prim? A: You need to know the local rotation of the root prim of the the attachment and divide your target rotation by the root's local rotation. _____________________
L$ is the root of all evil
videos work! thanks SL ![]() |
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
03-03-2008 17:41
I believe there is a pretty severe defect in this operation, that makes it so you have to do a very strange, incorrect calculation to get the results you want. Maybe someone knows the JIRA issue offhand...?
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
03-03-2008 19:38
SVC-93 --> https://jira.secondlife.com/browse/SVC-93
world relative workaround: llSetPrimtiiveParams([PRIM_ROTATION, (rot / llGetRootRotation) / llGetRootRotation); local relative workaround: llSetPrimitiveParams([PRIM_ROTATION, rot/llGetRootRotation]); _____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
03-03-2008 19:54
Thanks Void!
![]() |
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
03-03-2008 21:03
it's one of those issue that got me right between the eyes, kinda hard to forget.
_____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |
|
Farallon Greyskin
Cranky Seal
Join date: 22 Jan 2006
Posts: 491
|
03-03-2008 21:07
SVC-93 --> https://jira.secondlife.com/browse/SVC-93 world relative workaround: llSetPrimtiiveParams([PRIM_ROTATION, (rot / llGetRootRotation) / llGetRootRotation); local relative workaround: llSetPrimitiveParams([PRIM_ROTATION, rot/llGetRootRotation]); Note that this does not work in an attachement ![]() I believe it USED to, where llGetRootRotation /actually/ returned something that would be "llGetRootLocalRotation()" (if such a command existed) but unfortunately it only returns <0,0,1,0> now ALWAYS. THis makes sens on one level but is actually totally USELESS. When an object is unattached, using the above equations work great using the global rotation of the root prim that is returned, when attached, that functions SHOULD return the local rotation of the root prim becuase it would /functionally/ be the same thing. I.e. an object would behave identically whether attached or not. Unfortuantely that is not the case now... And with the absense of an llGetRootLocalRotation function, you are left with having to have the root prim get it's own local rotation and link message it to any child prims that need to use that info ![]() |
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
03-04-2008 11:31
the workaround would be to get the rotation of the root, from the root, an use a link msg to inform the child prims...
another workaround would be to do the calls from the root, and use get local rot and set link prim params.... there are situations in which it doesn't matter, and you can just add the local degrees onto what is being set (I used this for wings), but it takes a little trial an error. _____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |
|
Vinnie Baxter
Registered User
Join date: 5 Feb 2007
Posts: 17
|
03-04-2008 12:09
tnx for the response guys; these rotations still freak me out
|
|
Kittie Munro
Registered User
Join date: 28 May 2007
Posts: 29
|
I now have such a headache!
03-05-2008 10:33
I think this might be the thing I was looking for, but I'm such a scripting newbie that you all appear to be speaking a completely alien language
![]() I've been scouring the forums looking for a rotation (or llTARGETOMEGA) script that will allow for repositioning... for instance... I have a windmill, with sails... that go around and around (yes this is the limit of my scripting abilities) which is all very lovely, but when I move/turn my windmill... the sails do not reposition themselves and they continue to rotate in relation to their original position (which looks very odd). Please does anyone know of a fairly simple rotational script that will reposition the rotate when moved? Many thanks |
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
03-05-2008 20:49
for Set Rot type rotations, it'd be
llSetRot( arc2traverse * llGetRot() ); for target omega type rotations (non physical) llTargetOmega( axis * llGetRot(), spinrate, gain ); //-- I believe _____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |
|
Kittie Munro
Registered User
Join date: 28 May 2007
Posts: 29
|
Even closer!
03-06-2008 09:49
for target omega type rotations (non physical) llTargetOmega( axis * llGetRot(), spinrate, gain ); //-- I believe This really does look exactly like the kind of thing I'm looking for! You're a genius Void! Now.. how can I get this translated from martian into english? (how does that fit into a script?) spinrate and gain = numbers? definition for axis?? aarrghh! confused... and blonde... ~ Kittie |
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
03-06-2008 16:29
assuming that's the right formula, spin rate is a float that detrmines how many times times the axis rotation happens in radians per second (TWO_PI = 1/sec), and gain should be a float of how quicklly it gets up to that full speed (I'm not sure how this works, it could be in fractions of force, or seconds till full speed, or whatever, but it appears not to matter for non-physics enabled objects, unless it's 0 so just use 1)
for spinrate to be exactly the number of rotations per seceond at full speed, axis (a vector describing the axis to rotate on) should be either (-)1 in one axis and zero in all others, or should be normalized using llVecNorm... as an example of an object that spins around it's y-axis 2 times per second llTargetOmega( <0.0, 1.0, 0.0> * llGetRot(), 2.0 * TWO_PI, 1.0 ); if some other more complex vector is being used then you should use llTargetOmega( llVecNorm( <0.0, 1.0, 0.0> ) * llGetRot(), 2.0 * TWO_PI, 1.0 ); to get the same effect. presumably called from the root of your sails (which should be both their center and not connected to the larger structure) references: https://wiki.secondlife.com/wiki/llTargetOmega now the first link says all root usage results in global rotation frame, while the second says it becomes local for physical objects... _____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |
|
Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
|
03-07-2008 09:21
void, you're my rotation hero!!!!
at last, a LOCAL AXIS target omega function! so um... what other good secrets do you know? lol! _____________________
Why Johnny Can't Rotate:
http://forums.secondlife.com/showthread.php?t=94705 |
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
03-07-2008 13:49
CODE
the formula for rotating a prim around an offset point (which is wrong on both top wikis last I checked, really must correct at least one of them) with no anchor prim. can be adapted (and probably has) for multi-move type non-phys vehicles to smooth turns without large jumps in pos (depending on object width). I used a similar formula to make oval particle effects (it traces the oval instead of being a burst though)... ok off to edit the LSL portal now that I'm reminded. the same principle (used in the previous posts) is used for anything that uses an offset point that need to be relative to the facing of an object (doors, rezzors, bullets, holo vendors, lids, trunks, etc ad nauseam) just multiply your local vector offset times the objects rot to get a point (or in OP's case a spin) relative to the objects facing regardless of region facing. (I didn't come up with it) EDIT: I updated LSL Portal, trying to keep as much of the original formatting as possible, but it's ugly (rotations page, section on rotating vectors), if anyone knows french or japanese the change should be made to those languages too, I'd do it but translating via alta-vista or similar is bound to just make it incomprehesible. _____________________
|
| . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - |