|
Zi Ree
Mrrrew!
Join date: 25 Feb 2006
Posts: 723
|
03-31-2006 01:45
[Moved thread from Building to here, wrong forum  ] Hi! I have a linked set of prims and would like to rotate one of the child prims in a way that it compensates the rotation of the root prim. For example I have a bascule bridge which can be opened and closed, rotating around a pivot point. Now I link a stick to the bridge, which is supposed to point straight down at all times. How am I going to compensate this motion? I tried llGetRootRotation() and subtracting the axis in question from the child prim's rotation (in Euler), but at some point the rotation just "flips", even switches to rotations of other axes than I want to manipulate. I guess, the conversion from Euler to Rotation does some weird things to the values. Is there an easy to understand way on how to achieve this? I guess it involves quaternations, and I have no clue on how to use them. Any help would be greatly appreciated!
_____________________
Zi! (SuSE Linux 10.2, Kernel 2.6.13-15, AMD64 3200+, 2GB RAM, NVidia GeForce 7800GS 512MB (AGP), KDE 3.5.5, Second Life 1.13.1 (6) alpha soon beta thingie) Blog: http://ziree.wordpress.com/ - QAvimator: http://qavimator.orgSecond Life Linux Users Group IRC Channel: irc.freenode.org #secondlifelug
|
|
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
|
03-31-2006 02:13
You want to divide the child prim's rotation by llGetRootRotation(), not subract. 
|
|
Zi Ree
Mrrrew!
Join date: 25 Feb 2006
Posts: 723
|
03-31-2006 02:29
Thank you for your answer!
So basically I do:
// somewhere in on_rez() or wherever... rotation desiredRot = llGetRot();
// later in a loop / timer() llSetRot( desiredRot / llGetRootRot() );
Additionally (which I forgot) ideally this should only go for one of the axes (y axis ... pitch). The other two axes should still rotate the prim as expected. Argh .. this is so easy to show but so hard to explain ...
_____________________
Zi! (SuSE Linux 10.2, Kernel 2.6.13-15, AMD64 3200+, 2GB RAM, NVidia GeForce 7800GS 512MB (AGP), KDE 3.5.5, Second Life 1.13.1 (6) alpha soon beta thingie) Blog: http://ziree.wordpress.com/ - QAvimator: http://qavimator.orgSecond Life Linux Users Group IRC Channel: irc.freenode.org #secondlifelug
|
|
Sheila Plunkett
On The Prowl!
Join date: 25 Dec 2005
Posts: 67
|
04-02-2006 12:32
The issue is that it's an attachment.
All rotations you can read with the current LSL commands return the rotation relative to the attachment point, basically. What you need is the difference between the attachment point's rotation and the world, and I am not sure there's any way to find that out.
So, the attached prim has rotation <x1,y1,z1> relative to the attachment point. But what rotation does it have relative to the world? That's the issue.
Any ideas?
*meow* Sheila!
|
|
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
|
04-02-2006 18:28
From: Sheila Plunkett What you need is the difference between the attachment point's rotation and the world, and I am not sure there's any way to find that out. Unfortunately, you can't. The attachment point's rotation and position relative to the world depends on the current animation playing, which is client side. The server only knows what animation is playing, not what the anim is actually doing. If you want to rotate a subprim of an attachment relative to the root prim, you'll need to use llGetLocalRot() in the root and send that to the subprim, which will divide the desired rotation by the rotation sent from the root. Unless they fixed it, llGetRootRotation() in a subprim of an attachment does not give the rotation of the root prim.
|
|
Zi Ree
Mrrrew!
Join date: 25 Feb 2006
Posts: 723
|
04-03-2006 01:02
Thank you for clarification. So there's no use in pursuing this project further. At least now I know that I'm not missing something  Thanks for your replies!
_____________________
Zi! (SuSE Linux 10.2, Kernel 2.6.13-15, AMD64 3200+, 2GB RAM, NVidia GeForce 7800GS 512MB (AGP), KDE 3.5.5, Second Life 1.13.1 (6) alpha soon beta thingie) Blog: http://ziree.wordpress.com/ - QAvimator: http://qavimator.orgSecond Life Linux Users Group IRC Channel: irc.freenode.org #secondlifelug
|