Difference between revisions of "PRIM GLOW"

From Second Life Wiki
Jump to: navigation, search
m
m (<lsl> tag to <source>)
 
Line 38: Line 38:
 
|examples=
 
|examples=
 
basic syntax to set glow
 
basic syntax to set glow
<lsl>
+
<source lang="lsl2">
 
// adjust as desired .3 to a float number from 0 to 1.0 inclusive
 
// adjust as desired .3 to a float number from 0 to 1.0 inclusive
 
// adjust as desired ALL_SIDES to specific prim faces if desired
 
// adjust as desired ALL_SIDES to specific prim faces if desired
  
 
llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES, .3 ] ) ;  
 
llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES, .3 ] ) ;  
</lsl>
+
</source>
  
 
basic syntax to get glow status
 
basic syntax to get glow status
<lsl>
+
<source lang="lsl2">
 
list mylist = llGetPrimitiveParams([ PRIM_GLOW,ALL_SIDES] );
 
list mylist = llGetPrimitiveParams([ PRIM_GLOW,ALL_SIDES] );
 
llSay(0, llList2CSV(mylist));
 
llSay(0, llList2CSV(mylist));
Line 56: Line 56:
 
//change ALL_SIDES to a specific prim face if desired.
 
//change ALL_SIDES to a specific prim face if desired.
  
</lsl>
+
</source>
  
  
  
<lsl>//Each time the prim is touched, the intensity of the glow is increased (until it maxes out and cycles back to zero).
+
<source lang="lsl2">//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 steps = 10;
 
integer counter = 0;
 
integer counter = 0;
Line 71: Line 71:
 
         counter = (counter + 1) % steps;
 
         counter = (counter + 1) % steps;
 
     }  
 
     }  
}</lsl><lsl>//Each time the prim is touched, the intensity of the glow is decreased (until it hits zero and cycles back to one).
+
}</source><source lang="lsl2">//Each time the prim is touched, the intensity of the glow is decreased (until it hits zero and cycles back to one).
 
integer steps = 10;
 
integer steps = 10;
 
integer counter = 0;
 
integer counter = 0;
Line 82: Line 82:
 
         counter = (counter + steps - 1) % steps;
 
         counter = (counter + steps - 1) % steps;
 
     }  
 
     }  
}</lsl>
+
}</source>
 
|constants=
 
|constants=
 
{{LSL ConstRow|CHANGED_TEXTURE}}
 
{{LSL ConstRow|CHANGED_TEXTURE}}

Latest revision as of 16:39, 23 January 2015

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

basic syntax to set glow

// adjust as desired .3 to a float number from 0 to 1.0 inclusive
// adjust as desired ALL_SIDES to specific prim faces if desired
 
llSetPrimitiveParams( [ PRIM_GLOW, ALL_SIDES, .3 ] ) ;

basic syntax to get glow status

list mylist = llGetPrimitiveParams([ PRIM_GLOW,ALL_SIDES] );
llSay(0, llList2CSV(mylist));
 
//Assuming for this example that all sides are set to the same float of .3 
//In a box, which has 6 sides, the above example returns 0.300000, 0.300000, 0.300000, 0.300000, 0.300000, 0.300000
//In a prism, which has 5 sides, returns 0.300000, 0.300000, 0.300000, 0.300000, 0.300000
//In a sphere, which has only 1 side (as it were), returns 0.300000
//change ALL_SIDES to a specific prim face if desired.


//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;
    } 
}
//Each time the prim is touched, the intensity of the glow is decreased (until it hits zero and cycles back to one).

integer steps = 10; integer counter = 0;   default {

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

Deep Notes