StoneyNcrazy Diabolito
Registered User
Join date: 20 May 2009
Posts: 12
|
11-18-2009 23:14
I need some help finding or writing some code to rotate an object such as a fan, car tire, basically something that will create a spinning effect. I have coded in C++, Visual basic, & Visual fox pro, but lsl is new to me. I found a piece of code that rotates an object in increments, but the user needs to keep clickin the object for it to spin. I was wondering if there was a piece of code or key word, that would allow me to rotate an object on an axis automatically or constantly, or anything that i could use to click it on and off. Anything would be a great help and appreciated. I have looked thru the tutorials and scripting portal, but not had any luck, partly because I dont know my way around there very well as of yet. Anyways here is the piece of code i found to rotate my ceiling fan in increments, but I want it to keep spinning after it is clicked. Or maybe some code that will allow the user to turn the fan ON & OFF, by simply clickin it. Thx again for any info to help me solve this. ~StoneyNcrazy~ ;=O) rotation rot_xyzq; default { state_entry() { vector xyz_angles = <0,1.0,0>; // This is to define a 1 degree change vector angles_in_radians = xyz_angles*DEG_TO_RAD; // Change to Radians rot_xyzq = llEuler2Rot(angles_in_radians); // Change to a Rotation } touch_start(integer s) { llSetRot(llGetRot()*rot_xyzq); //Do the Rotation... } }
P.S. Can someone also refer me to a group or class in SL that I could join or attend to help me learn the lsl coding program?
|
Ovaltine Constantine
Registered User
Join date: 28 Jul 2008
Posts: 179
|
11-19-2009 00:10
|
StoneyNcrazy Diabolito
Registered User
Join date: 20 May 2009
Posts: 12
|
11-19-2009 01:25
Thank you very much for your help Ovaltine. Got it spinning. Appreciate it. ;=O) Know of any good groups or classes I could join on SL to learn scripting?
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
11-19-2009 05:49
Try Search >> Events >> Education. There's usually something going on somewhere in SL. Or you can learn the way a lot of us have .... run through a few tutorials in the wiki, reverse engineer sample scripts from anywhere you find them, and practice a lot. LSL is actually a pretty easy language to work with, even though it has more than its share of quirky design features. If you've worked in other languages before, you should be able to pick it up quickly once you get your head around the notion of states and events.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
StoneyNcrazy Diabolito
Registered User
Join date: 20 May 2009
Posts: 12
|
11-21-2009 03:11
Thank you very much for the reply Rolig. Will look into it. Yes main thing for me to get down is the lsl terminology for keywords functions and so on. Appreciate the advice and help. Have a great weekend. Peace. ~StoneyNcrazy~
|