Help w Rotation Script Please - SLUniverse Forums
 
Navigation » SLUniverse Forums > Development Discussion and Support > Scripting » Help w Rotation Script Please


Scripting Discuss scripting for SL and other platforms

Reply
 
LinkBack Thread Tools Display Modes
Old 10-22-2009, 12:50 PM   #1 (permalink)
Senior Member
 
Pamela Galli's Avatar
Refugee
 
Join Date: Sep 2009
Posts: 296
My Mood:
SLShopper Ads: 1
SL Join Date: 11-12-2007
Business: La Galleria
Help w Rotation Script Please

My scriptor left SL, but he made this for my ceiling fan. The touch part is in the light, which I just updated with a sculpt, and had to change the rotation of the sculpted light, which I assume is why now my sculpted fan blades (4 blades in one prim) rotate end over end (vertically) instead of horizontally, as they did before. I looked at the rotation script and can't see what to change -- plus there is the word PI in there, which is kind of scary. Anyone know how to fix the script so my blades will rotate normally?

Thanks!

default
{
state_entry()
{
llTargetOmega(<0.0,0.0,0.0>,PI,0.0);
}
link_message(integer sender_number, integer number, string message, key id)
{
if (number!=9) return;
if (message=="ON") llTargetOmega(<1.0,0.0,0.0>,PI,1.0);
else
llTargetOmega(<0.0,0.0,0.0>,PI,0.0);
}
on_rez(integer start_param)
{
llResetScript();
}
}
__________________
Have a dinner party! Cook it in your kitchen and serve it in your dining room!

LA GALLERIA
Pamela Galli is offline   Reply With Quote
Old 10-22-2009, 01:03 PM   #2 (permalink)
Queen Dork
 
Zanne Boucher's Avatar
Mah eyes are tired!
 
Join Date: Oct 2009
Location: Florida
Posts: 74
My Mood:
SLShopper Ads: 22
SL Join Date: 6/15/07
Business: *ZOE* Decor
Blog Entries: 3
Yikes! I think PI is the direction the blades turn, as in forward or backward. Beyond that, I'm really not sure.
__________________




"If you HAVE to say the wrong thing, say it loudly and with consequence!"
Zanne Boucher is offline   Reply With Quote
Old 10-22-2009, 01:47 PM   #3 (permalink)
Soul Vaccinated
 
jacqueline trudeau's Avatar
Breakin' prims in the hot sun
 
Join Date: Aug 2007
Location: Shantytown
Posts: 4,158
My Mood:
SLShopper Ads: 4
SL Join Date: 07/15/2005
Business: Trudeau Classic Sailing Yachts
Your llTargetOmega's rotation vector parameter needs adjustment.

Change the part that says llTargetOmega(<1.0,0.0,0.0>,PI,1.0) to either:

llTargetOmega(<0.0,1.0,0.0>,PI,1.0);

or

llTargetOmega(<0.0,0.0,1.0>,PI,1.0);


One of those is bound to work.
__________________
Trudeau Classic Sailing Yachts
jacqueline trudeau is offline   Reply With Quote
Old 10-22-2009, 01:55 PM   #4 (permalink)
Senior Member
 
Pamela Galli's Avatar
Refugee
 
Join Date: Sep 2009
Posts: 296
My Mood:
SLShopper Ads: 1
SL Join Date: 11-12-2007
Business: La Galleria
Quote:
Originally Posted by jacqueline trudeau View Post
Your llTargetOmega's rotation vector parameter needs adjustment.

Change the part that says llTargetOmega(<1.0,0.0,0.0>,PI,1.0) to either:

llTargetOmega(<0.0,1.0,0.0>,PI,1.0);

or

llTargetOmega(<0.0,0.0,1.0>,PI,1.0);


One of those is bound to work.
Thanks very much!
Pamela Galli is offline   Reply With Quote
Old 10-22-2009, 02:17 PM   #5 (permalink)
Soul Vaccinated
 
jacqueline trudeau's Avatar
Breakin' prims in the hot sun
 
Join Date: Aug 2007
Location: Shantytown
Posts: 4,158
My Mood:
SLShopper Ads: 4
SL Join Date: 07/15/2005
Business: Trudeau Classic Sailing Yachts
yw

btw, everyone knows PI aren't scary, neither r they square. PI r round!
jacqueline trudeau is offline   Reply With Quote
Old 10-22-2009, 03:44 PM   #6 (permalink)
Primus
 
gbostick999's Avatar
 
Join Date: Aug 2009
Location: Southeast Michigan
Posts: 9
My Mood:
SL Join Date: 09/27/2006
Groans and turns over...
gbostick999 is offline   Reply With Quote
Old 10-22-2009, 04:27 PM   #7 (permalink)
Soul Vaccinated
 
jacqueline trudeau's Avatar
Breakin' prims in the hot sun
 
Join Date: Aug 2007
Location: Shantytown
Posts: 4,158
My Mood:
SLShopper Ads: 4
SL Join Date: 07/15/2005
Business: Trudeau Classic Sailing Yachts
Quote:
Originally Posted by gbostick999 View Post
Groans and turns over...
Which is a very appropriate response in a thread about rotation.
jacqueline trudeau is offline   Reply With Quote
Old 10-22-2009, 11:09 PM   #8 (permalink)
Animates and Scripts
 
jeaniesing's Avatar
 
Join Date: Oct 2009
Location: rural northeast US
Posts: 33
My Mood:
SL Join Date: Sept 2006
for rotation on a local axis rather than global

Code:
//this script will activate low/no lag rotation -  meaning that it is seen on the users client, not played on the server. It makes objects spin when placed in their root - but cannot be used as a PART of a linked object in this format.

float speed = 2.0;// you can change this value to make  the spin go faster ansd slower... a negative value will change the direction of the spin
default 
{     
    state_entry()     
        {
            //if it isn't spinning correctly, put two slashes in front of the active line below and remove the two slashes from another, save and see if that works! 
            
            llTargetOmega(llRot2Up(llGetRot()),speed,PI); 
            //llTargetOmega(llRot2Fwd(llGetRot()),speed,PI); 
            //llTargetOmega(llRot2Left(llGetRot()),speed,PI);      
        }
}
__________________
jeaniesing is offline   Reply With Quote
Old 10-22-2009, 11:39 PM   #9 (permalink)
Senior Member
 
Pamela Galli's Avatar
Refugee
 
Join Date: Sep 2009
Posts: 296
My Mood:
SLShopper Ads: 1
SL Join Date: 11-12-2007
Business: La Galleria
Thanks Jeanie -- I resisted the impulse to send you the fan like I do everything else. Don't want to wear my scriptor out on piddly things (okay, they are all piddly)!
Pamela Galli is offline   Reply With Quote
Old 10-23-2009, 06:56 PM   #10 (permalink)
Animates and Scripts
 
jeaniesing's Avatar
 
Join Date: Oct 2009
Location: rural northeast US
Posts: 33
My Mood:
SL Join Date: Sept 2006
Hahaha .... if I am ever desperate for a ceiling fan I know who to ask
jeaniesing is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On