The argument of the particles is large enough. scripts particles have in fact devoted to an infinite number of parameters, and display all the combinations on the blog is almost impossible. What I will do here is to give a starting point, so as to understand the structure, so that you can take advantage of customized, want. The
particles (particles) are elements generated by a script ( one script per prim particles), have no mass, and through any superficie.Inoltre
have a life cycle in seconds, and always can be established via script color, speed, form, movement, direction
and much more.
What are they?
With particles, you can create many effects that would otherwise be impossible.
example, create a "snow" or "rain", or "fog." Or .. an 'explosion of fireworks and smoke, the splashing water .. etc etc.
move to. The bulk container that keeps all the parameters of the particles is the following function:
llParticleSystem ([parameter list]);
Let's now see an example of a script:
//--- --------------------------------------------
/ / create this function to then call in the event that I need
/ / in this case, a state_entry Particles () {
llParticleSystem ([
PSYS_PART_MAX_AGE , 4,
/ / second life of a particle
PSYS_PART_FLAGS, PSYS_PART_INTERP_COLOR_MASK
/ / initial size
PSYS_PART_END_SCALE , \u0026lt;1,1,0>,
/ / final size
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_EXPLODE ,
/ / mode explosion
PSYS_SRC_BURST_RATE, 00:05
,
/ / the lower are issued more quickly
PSYS_SRC_ACCEL,
\u0026lt;0,0,0> ,
/ / drive to one of the directions
PSYS_SRC_BURST_PART_COUNT , 32, / / number of particles emitted for today "project"
PSYS_SRC_BURST_RADIUS , 0.5, / / radius
PSYS_SRC_BURST_SPEED_MIN , 0.5,
PSYS_SRC_BURST_SPEED_MAX , 1,
/ / PSYS_SRC_TARGET_KEY, target, / / \u200b\u200bUUID of an avatar or object to which to direct the particles
/ / PSYS_SRC_INNERANGLE, innerAngle,
/ / PSYS_SRC_OUTERANGLE, outerAngle,
/ / PSYS_SRC_OMEGA, omega,
PSYS_SRC_MAX_AGE
, 0,
/ / if it is to 0, the duration is infinite
/ / PSYS_SRC_TEXTURE, texture,
PSYS_PART_START_ALPHA
, 0.5, PSYS_PART_END_ALPHA , 1 / / end transparency (0 to 1)
]);
default} {
default} { state_entry
() { Particles ();
}} / / - if you copy / paste may not work
/ / - because of the different text formatting
As soon as the script starts, you will see a number of "particles" reds come out from the first explosion mode, the following the wind (yes, SL is also present in the wind) and gradually become green.
This is the result:
Some of the many parameters I have explained in orange in the script itself. PSYS_PART
refers to the characteristics of the particles,
PSYS_SRC the characteristics of the source that issued them.
Most of the parameters are easily intuibili.Alcuni are truly special.
An interesting example is the list of flags (
PSYS_PART_FLAGS
, + type flag), special features such as the interaction with the wind, glow, change color, size and alpha.
Notice how I wrote:
PSYS_PART_FLAGS
, wind + flag
//---------------------------------------------
default
{
state_entry
() {
([]);
/ / is like an empty list }}
//-------------------------------- -----------------
report some practical examples that you can safely experiment based on the script that I included at the beginning.
Mode emission: choosing one of these options, the particles take the form diversa.Le descriptions can be found easily on the wiki quote above. PSYS_SRC_PATTERN_EXPLODE
PSYS_SRC_PATTERN_DROP PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY PSYS_SRC_PATTERN_ANGLE_CONE
PSYS_SRC_PATTERN_ANGLE Flags:
PSYS_PART_EMISSIVE_MASK; PSYS_PART_BOUNCE_MASK; PSYS_PART_INTERP_COLOR_MASK;
PSYS_PART_INTERP_SCALE_MASK; PSYS_PART_WIND_MASK; PSYS_PART_FOLLOW_SRC_MASK;
PSYS_PART_FOLLOW_VELOCITY_MASK; PSYS_PART_TARGET_POS_MASK;
A good practice is to group and specify the first (or stating any vector float or integer) values, so that it can be changed quickly and more practical. This is especially useful for flags, where you can declare much earlier and simply decide a TRUE or FALSE each value.
me give an example with the same script above: //----------------------------------- ------------ Particles () {
integer glow = TRUE ; integer bounce = FALSE ;
integer interpColor = TRUE ; integer interpSize =
TRUE ; integer wind = FALSE
; integer followSource = FALSE ;
integer followVel = TRUE
; integer followTarget =
FALSE ;
integer flags;
//raggruppo tutte le flag flags = 0; if (glow) flags = flags
; if (followSource) flags = flags PSYS_PART_START_SCALE , <0.2,0.2,0>,
PSYS_PART_END_SCALE , <1,1,0>, PSYS_SRC_PATTERN
, PSYS_SRC_PATTERN_EXPLODE , PSYS_SRC_BURST_RATE ,0.05,
PSYS_SRC_ACCEL , <0,0,0>, PSYS_SRC_BURST_PART_COUNT ,32,
PSYS_SRC_BURST_RADIUS
, 0.5,
PSYS_SRC_BURST_SPEED_MIN ,0.5,
PSYS_SRC_BURST_SPEED_MAX
,1,
// PSYS_SRC_TARGET_KEY,target,
// PSYS_SRC_INNERANGLE,innerAngle,
/ / PSYS_SRC_OUTERANGLE, outerAngle,
/ / PSYS_SRC_OMEGA, omega,
PSYS_SRC_MAX_AGE
PSYS_PART_START_ALPHA
, 0.5,
/ / transparency initial (0 to 1)
PSYS_PART_END_ALPHA
, 1 / / end transparency (0 to 1)
; ]);}
default {
state_entry () {
Particles ();} }
//-------------------------- --------------------------------------------- Try to play with values, such as size, color and alpha. In the second part we will see how to apply a texture to the particles, and also some other ways different emission dall'explode.
/ / PSYS_SRC_TEXTURE, texture,
0 comments:
Post a Comment