Rotating Prim

From OpenSimulator

Jump to: navigation, search

Rotating Prim

I think this came from Nebaden  :-) ...

In this script snippet, we have a default state that contains a state entry event handler. When the object enters this state, the state_entry() function is triggered automatically.

Inside the state_entry() function, two functions are called:

   llSetText("put your text in here", <1.0, 1.0, 1.0>, 1.0);
       This function sets text on the object. The text to be displayed is "put your text in here".
       The second parameter <1.0, 1.0, 1.0> represents the color of the text. It's specified in RGB format, where each value ranges from 0.0 to 1.0.
       The third parameter 1.0 represents the alpha (transparency) of the text. In this case, the text is fully opaque.
   llTargetOmega(<0.0, 0.0, 1.0>, 0.2, 2);
       This function sets the rotational speed (angular velocity) of the object.
       The first parameter <0.0, 0.0, 1.0> represents the axis of rotation. Here, it specifies rotation around the Z-axis.
       The second parameter 0.2 specifies the speed of rotation in radians per second.
       The third parameter 2 specifies the time duration for which the rotation will continue in seconds.

Overall, when the object enters the default state, it will display the specified text and start rotating around its Z-axis at the defined speed for the specified duration.

default 
{
    state_entry()
    {
        llSetText("put your text in here", <1.0, 1.0, 1.0>, 1.0);
        llTargetOmega(<0.0, 0.0, 1.0>, 0.2, 2);
    }
}
Personal tools
General
About This Wiki