|
Trolane Demonia
Registered User
Join date: 26 Jan 2008
Posts: 150
|
05-03-2008 09:26
I have a prim i am able to move and rotate 90 degress so it works like a folding down thing hanging from the roof. how do i make it flip 90 degrees up so the face folds up no matter what the oroginal rotation was? any change in the z value of the rotation means x and y take different meanings for flipping it up. this script works fine if the original roation is 0,0,0 if i make it 90 on the z then the 90 needs to be applied to y in order to flip up instead of the x. how do i make something that doesnt care what the z is? vector size = llGetScale(); float h = (size.z / 2) - .1; if(down) { rotation rot; rot = llEuler2Rot(<90 * DEG_TO_RAD, 0,0>  ; rotation newrot = currentrot * rot; llSetPos(llGetPos() + <0.0, 0.0, h>  ; llSetRot(newrot); down = FALSE; } else { llSetPos(llGetPos() - <0.0, 0.0, h>  ; llSetRot(currentrot); down = TRUE; }
|
|
ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
|
05-03-2008 11:08
I'm not sure I understand your question, but try this: /15/e4/138010/1.htmlIt allows you to define the rotation relative to the root prim.
_____________________
 VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30 http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240 http://shop.onrez.com/Archtx_Edo
|
|
Trolane Demonia
Registered User
Join date: 26 Jan 2008
Posts: 150
|
05-05-2008 08:39
there is no root prim in my thing.
what i have is a prim that does the following if the rotation is 0,0,0
it will move down half its size and rotate 90 degrees to show itself, its a fold up tv. if i change the rotation to anything other than 0,0,0 the values i need to change for 90 deg flip is no longer just X. I am trying to figure out how to get around caring wether the x or y is the new value needing change depending on the z's rotation.
nothing i have found lets me just say add 90 degrees to the x and always have be the same direction regardless of the z.
|
|
Trolane Demonia
Registered User
Join date: 26 Jan 2008
Posts: 150
|
05-05-2008 10:08
figured it out. had to do with someones stupid idea to make the order of operands in the rotation multiplications matter.
yay just imagine if the rest of life was like SL scripting. 1 x 0 = 0 but 0 x 1 = 1 !!
|