Difference between revisions of "PRIM GLOW"

From Second Life Wiki
Jump to navigation Jump to search
m (Overly complex example)
Line 34: Line 34:
|r1_type=float|r1_name=intensity
|r1_type=float|r1_name=intensity
}}
}}
==Exemple==
|examples=<lsl>//Each time the prim is touched, the intensity of the glow is increased (until it maxes out and cycles back to zero).
<lsl>///Exemple
integer steps = 10;
 
integer counter = 0;
 
//glow intensity on touch by """"MathieuBC Noel""""MY Free products available on www.slexchange.com
//Changes a prim from glow intensity  again each time it is touched
 
 
integer PRIM_GLOW = 25;


default  
default  
{
{
    touch_start(integer total_number)
    {
        llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES,  .01 ]); state unlit; //intensity is the range of 0.01 to 1
    }
}
 
state unlit
{
    touch_start(integer total_number)
    {
        llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES,  .02 ]); state unlit2;
    }
}
state unlit2
{
    touch_start(integer total_number)
    {
        llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES,  .03 ]); state unlit3;
    }
    }
state unlit3
{  
     touch_start(integer total_number)  
     touch_start(integer total_number)  
     {  
     {  
         llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES,  .04 ]); state unlit4;
         llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES,  counter / (steps - 1.0) ]);
    }
         counter = (counter + 1) % steps;
    }
state unlit4
{
    touch_start(integer total_number)
    {
         llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES,  .1 ]); state default ;
    }
     }  
     }  
</lsl>
}</lsl>
|examples
|constants=
|constants=
{{LSL ConstRow|CHANGED_TEXTURE}}
{{LSL ConstRow|CHANGED_TEXTURE}}
Line 91: Line 55:
{{LSL DefineRow||[[changed]]|}}
{{LSL DefineRow||[[changed]]|}}
|location
|location
|history=Added in client version 1.20
|history=Added in {{SVN|337|rev=81900|branch=Release|ver=1.20.0|anchor=file6|date=Monday, 10 March 2008}}
|cat1=Face
|cat1=Face
|cat2=Prim
|cat2=Prim

Revision as of 20:44, 23 May 2008

Description

Constant: integer PRIM_GLOW = 25;

The integer constant PRIM_GLOW has the value 25

PRIM_GLOW is used to get or set the glow status of the face. Use the integer number 25 if the compiler rejects the named constant.

llSetPrimitiveParams

[ PRIM_GLOW, integer face, float intensity ]
• integer face face number or ALL_SIDES
• float intensity ranges from 0.0 to 1.0

When used with llSetPrimitiveParams & llSetLinkPrimitiveParams

llGetPrimitiveParams

llGetPrimitiveParams([ PRIM_GLOW, integer face ]);

Returns the list [ float intensity ]

• integer face face number or ALL_SIDES

• float intensity ranges from 0.0 to 1.0

Caveats:

  • If face is ALL_SIDES then the PRIM_GLOW works on all sides.
  • If face indicates a face that does not exist the PRIM_GLOW return is [ 0.0 ]

Related Articles

Constants

•  CHANGED_TEXTURE

Functions

•  llSetPrimitiveParams
•  llSetLinkPrimitiveParams
•  llGetPrimitiveParams

Events

•  changed

Examples

<lsl>//Each time the prim is touched, the intensity of the glow is increased (until it maxes out and cycles back to zero). integer steps = 10; integer counter = 0;

default {

   touch_start(integer total_number) 
   { 
       llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES,  counter / (steps - 1.0) ]);
       counter = (counter + 1) % steps;
   } 

}</lsl>

Deep Notes