|
Brett Bjornson
Registered User
Join date: 8 Nov 2005
Posts: 25
|
01-16-2007 13:55
I've created a rocking chair and want it to rock. I have this script: rotation Inverse(rotation r) { r.x = -r.x; r.y = -r.y; r.z = -r.z; return r; } rotation GetParentRot() { return Inverse(llGetLocalRot())*llGetRot(); } SetLocalRot(rotation x) { llSetRot(x*Inverse(GetParentRot())); } vector normal = <1.5, 1.0, 1.5>; default { state_entry() { @a; SetLocalRot(llEuler2Rot(<normal.x, normal.y, normal.z + 1>  ); SetLocalRot(llEuler2Rot(normal)); SetLocalRot(llEuler2Rot(<normal.x, normal.y, normal.z - 1>  ); SetLocalRot(llEuler2Rot(normal)); jump a; } } It turns the chair upside down, and rocks the chair from side to side, not back and forth! What am I missing? Thanks in advance.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
01-16-2007 14:08
Could just be the orientation of the prims when it was linked, or more specifically the orientation of the root prim in relation to world axis
|
|
Brett Bjornson
Registered User
Join date: 8 Nov 2005
Posts: 25
|
How do I change the prim orientation?
01-16-2007 16:58
OK, how do I change that?
|
|
XelNaga Gamba
Amateur Master Scripter
Join date: 12 Dec 2006
Posts: 20
|
01-16-2007 22:56
You can create a fully invisable prime in the center of the chair (or some where near it) set its rotation to 0,0,0. then Unlink your chair, select all the chair pieces saving the new prim to be select last. Then link them. The new prim should be the new root, just move the script from your old root to the new root.
|