| Scripting Discuss scripting for SL and other platforms |
| |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| Senior Member ![]() ![]()
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 |
| | |
| | #2 (permalink) |
| Queen Dork ![]()
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. |
| | |
| | #3 (permalink) |
| Soul Vaccinated ![]() ![]() ![]() ![]()
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 |
| | |
| | #4 (permalink) | |
| Senior Member ![]() ![]()
Refugee
Join Date: Sep 2009
Posts: 296
My Mood: SLShopper Ads: 1 SL Join Date: 11-12-2007
Business: La Galleria
| Quote:
| |
| | |
| | #5 (permalink) |
| Soul Vaccinated ![]() ![]() ![]() ![]()
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! |
| | |
| | #6 (permalink) |
| Primus ![]() Join Date: Aug 2009 Location: Southeast Michigan
Posts: 9
My Mood: SL Join Date: 09/27/2006
Business: Castles In The Air / Jus'Punk | Groans and turns over... |
| | |
| | #8 (permalink) |
| Animates and Scripts ![]() Join Date: Oct 2009 Location: rural northeast US
Posts: 33
My Mood: SL Join Date: Sept 2006
Business: jeaniesing's things | 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);
}
}
|
| | |
| | #9 (permalink) |
| Senior Member ![]() ![]()
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)! |
| | |
| | #10 (permalink) |
| Animates and Scripts ![]() Join Date: Oct 2009 Location: rural northeast US
Posts: 33
My Mood: SL Join Date: Sept 2006
Business: jeaniesing's things | Hahaha .... if I am ever desperate for a ceiling fan I know who to ask |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |