Rotation Brain Fart
|
|
Moon Corrigible
Registered User
Join date: 19 Jan 2007
Posts: 75
|
05-17-2009 17:19
I am having one of those days  OK I want to rez the pillow a little ways away from the chair upon the users command. I'm using: PillowPos = llGetPos() + (<-0.906, 0.568, 0> * llGetRot()); PillowRot = llEuler2Rot(<270, 0, 0>*DEG_TO_RAD) * llGetRot(); llRezObject(PILLOW, PillowPos, llGetVel(), PillowRot, CHANNEL); But it isnt *quite* right. It works wonderfully when the chair is in its starting rezzed position, but as soon as I rotate it a little the pillow drifts just a tiny bit off to the side. Not enough to be a big problem but enough to frustrate me. I've tried PillowPos = llGetPos() + (<-0.906, 0.568, 0> * llGetLocalRot()); and PillowPos = llGetPos() + (<-0.906, 0.568, 0.001> * llGetRot()); and even PillowPos = llGetPos() + (-0.906 * llRot2Fwd(llGetRot)) + (0.568 + llRot2Up(llGetRot)); I'm sure the answer is staring me in the face but quaternions ARE the root of all evil *grin* Thanks in advance!!
|
|
Moon Corrigible
Registered User
Join date: 19 Jan 2007
Posts: 75
|
05-17-2009 18:12
whimper
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
05-17-2009 19:14
Hmmmm... Looks like everyone is off partying.  I'm no rotation expert but for what it's worth, it looks like PillowPos = llGetPos() + (<-0.906, 0.568, 0.0> * llGetLocalRot()) ought to work for calculating the offset. It doesn't?
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
|
Moon Corrigible
Registered User
Join date: 19 Jan 2007
Posts: 75
|
05-17-2009 19:18
I tried it again just to make sure I hadn't borked it the first time through and no it does not seem to work.
Interestingly it seems to be off on that last axis (left to right in my case) which I have at 0 change - which is why I thought 0.001 might work
whimper
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
05-17-2009 19:20
Order of evaluation? PillowPos = (llGetPos() + <-0.906, 0.568, 0>  * llGetRot();
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Moon Corrigible
Registered User
Join date: 19 Jan 2007
Posts: 75
|
05-17-2009 19:29
From: Jesse Barnett Order of evaluation? PillowPos = (llGetPos() + <-0.906, 0.568, 0>  * llGetRot(); That didnt seem to work at all - at least I cant find where the pillow rezzed. I did try PillowPos = llGetPos() + <0.906, 0.568, 0> * llGetRot(); too just because the second life wiki seemed to say that was the thing to use: "correctOffset = llGetPos() + offset * llGetRot();" I'm sure I'm missing something obvious I just have no clue what it is.
|
|
Moon Corrigible
Registered User
Join date: 19 Jan 2007
Posts: 75
|
05-17-2009 20:09
OK by everything that I can see Jesse's suggestion SHOULD have worked.
Which means that I'm borking something else *sigh*. So I'm taking my sorry butt to bed. Night all! Thanks so much for your help!!!
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
05-17-2009 20:10
Does it make any difference if you type 0 as an integer instead of 0.0 as a float in your vector? (Just shooting in the dark... Dunno why it SHOULD make a difference.)
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
|
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
|
05-17-2009 20:57
have you tried using llRezAtRoot() instead? I've found that for precise positioning of rezzed objects I'm always dead on using that instead.
_____________________
My SLExchange shopTypos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not. The function is working perfectly fine. It's just not working the way you wanted it to work.
|
|
Moon Corrigible
Registered User
Join date: 19 Jan 2007
Posts: 75
|
05-17-2009 22:07
HAPPY CHICKEN DANCE!!! THAT WAS IT!!!!
THANK YOU SENUKA!!!!!!!
And thank you everyone else for trying to help!! I really really really appreciate it!!!
HAPPY CHICKEN DANCE!!!!!!!
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
05-18-2009 02:29
lol well Senuka beat me to it... this is why I never recommend using rez object
_____________________
| | . "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... | - 
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
05-18-2009 03:39
From: Moon Corrigible OK by everything that I can see Jesse's suggestion SHOULD have worked.
Which means that I'm borking something else *sigh*. So I'm taking my sorry butt to bed. Night all! Thanks so much for your help!!! Actually no, mine suggestion did not work. I tried it out in world yesterday and found that your's was correct. When I popped back into the thread I saw that you had already tried it and found it did not work so I neglected to reply. Glad you found the answer!
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|