These forums are CLOSED. Please visit the new forums HERE
Off axis rotations |
|
|
Izanagi Asano
Registered User
Join date: 16 Apr 2007
Posts: 9
|
06-05-2007 09:25
I'm dumbfounded. I've been trying to make a ring of objects rotate using llTargetOmega but I cannot figure out how to make them rotate on anything other than the X, Y or Z axis. I thought it had something to do with dividing a rotation by another rotation or something to that efect but it isn't working. The basic idea is that I have a ring of boxes about 3m long around a center point and I want them all to rotate clockwise. But what seems to be happening is they all rotate around the X or Y axis. So instead of getting a nice ring I get something that seems to rotate off kilter. So my qeustion is very basically, if I wanted to have a object at a 45 degree angle to the X axis, what do I have to add in the script?
|
|
Ed Gobo
ed44's alt
Join date: 20 Jun 2006
Posts: 220
|
06-05-2007 18:05
Check out llGetRot () and llGetPos () for server side rotation control.
Probably need llSetPrimitivePars (check out http://wiki.secondlife.com/wiki/LlSetPrimitiveParams) to keep it smooth. llTargetOmega is only executed on the client. It will be seen differently by different clients. Some prims are cut in half (doors) to give the illusion of swinging around the prim's edge when they are really swinging around one axis. |
|
Simnelia Petrichor
Registered User
Join date: 10 Feb 2006
Posts: 35
|
06-06-2007 11:49
The first parameter of llTargetOmega is a vector which describes the direction of the axis around which the object rotates. Try setting it to <1.0, 1.0, 0.0> and see if that gets you closer to what you're looking for.
|
|
Markel Marchionne
Registered User
Join date: 12 Aug 2006
Posts: 7
|
06-07-2007 15:58
The thing is that llTargetOmega asks a rotation axis, but not its position, because it assumes it's always around the object center. To make it more clear, i's like using the cursors or handles from Edit window to rotate the object.
The LSLwiki should have an example script on the rotation or quaternion page, that allows to "rotate" an object around an arbitrary point... but beware, I said "rotate" cause it's really a move using llSetPos, rather than a llSetRot rotation. This means the object wil move as if it's rotating around the arbitrary point, but will always head in the same direction (you'll have to simultaneously use a rotation if you want that). The other, simpler solution is to make the ring of objects a single linked set, with a (eventually invisible) root prim as the center, where the llTargetOmega script will be. This can work if you want a smooth rotation, but it will be computed client-side, so everyone can see it in different positions, and for in-world actions like collisions, sitting etc it will count as if it were "not rotation and invisible". It all depends on what you want it to do. |