|
Jinne Ling
Registered User
Join date: 23 Jun 2007
Posts: 24
|
08-05-2008 15:37
i'm making a pillow with a torus shape. the dimple is pointing straight up and down (Z). my problem is: i'm putting a cross-leg sit script in the pillow, but i can't figure out how to get me to sit straight up with this script. the pillow shape is turned on it's side (in order to have the dimple pointing up), but the script is obviously set for a prim that is not turned on it's side. Here's the script. What do i have to do to make me sit straight up on a torus dimple, huh? script: key avatar; vector pos = <-0.25,0,0.8>; //adjust the position to fit object -must be //nonzero in at least one direction or script will not work! rotation rot = <0,0,0,0>; //adjust rotation (1 in any vector gives 90 deg) default { state_entry() { llSitTarget(pos, rot); } changed(integer change) { avatar = llAvatarOnSitTarget(); if(change & CHANGED_LINK) { if(avatar == NULL_KEY) { // You have gotten off llStopAnimation("sit_ground"  ; llReleaseControls(); llResetScript(); } else if(avatar == llAvatarOnSitTarget()) { // You have gotten on llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION ); } } } run_time_permissions(integer perms) { if(perms) { llStopAnimation("sit"  ; llStartAnimation("sit_ground"  ; } else { llUnSit(avatar); } } }
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
08-05-2008 15:52
Lex Neva is your friend  Get his two free scripts at: /54/6a/153963/1.html( or in world: search for Lex Neva and go to his shop ) follow the instructions and you are home free
_____________________
From Studio Dora
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
08-05-2008 16:13
That comment about "1 in any vector gives 90 deg" is bogus. That would actually be a 180 degree rotation about the axis. A 90 degree rotation about one of the primary axis looks like:
x-axis: <0.707107, 0.0, 0.0, 0.707107> (-x)-axis: <-0.707107, 0.0, 0.0, 0.707107>
y-axis: <0.0, 0.707107, 0.0, 0.707107> (-y)-axis: <0.0, -0.707107, 0.0, 0.707107>
z-axis: <0.0, 0.0, 0.707107, 0.707107> (-z)-axis: <0.0, 0.0, -0.707107, 0.707107>
If the axis of rotation is u, a quaternion rotation of theta about that axis is:
< u.x * llSin(theta/2.0), u.y * llSin(theta/2.0), u.z * llSin(theta/2.0), llCos(theta/2.0) >
|
|
Amara Twilight
Registered User
Join date: 16 Feb 2004
Posts: 47
|
08-06-2008 21:19
From: Hewee Zetkin That comment about "1 in any vector gives 90 deg" is bogus. That would actually be a 180 degree rotation about the axis. A 90 degree rotation about one of the primary axis looks like:
x-axis: <0.707107, 0.0, 0.0, 0.707107> (-x)-axis: <-0.707107, 0.0, 0.0, 0.707107>
y-axis: <0.0, 0.707107, 0.0, 0.707107> (-y)-axis: <0.0, -0.707107, 0.0, 0.707107>
z-axis: <0.0, 0.0, 0.707107, 0.707107> (-z)-axis: <0.0, 0.0, -0.707107, 0.707107>
If the axis of rotation is u, a quaternion rotation of theta about that axis is:
< u.x * llSin(theta/2.0), u.y * llSin(theta/2.0), u.z * llSin(theta/2.0), llCos(theta/2.0) > Brain Implodes...
|