Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Simple particle question...

Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
05-02-2006 15:40
I was playing around with particles a bit to see if I could do something like the rotating particles that appear when an object speaks, or when you delete/take an object. Its there a way to program particle movement in a circle without making an orbiting prim with follow_source?
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
05-02-2006 15:43
There's an omega parameter that does something like that, I think. Find the Particle Lab in SL, there are many helpful tutorials there that show you what the different parameters do.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
05-02-2006 15:50
Aye I have been to it a while ago. :)

I tried playing with the emitter omega, but it doesn't seem to affect the particles once they are emitted. I would expect that it would with follow_source, but I haven't been able to get the particles to change direction after emission.
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
05-02-2006 15:55
Try a bigger radius maybe? I've got it to work once or twice, but I totally suck at particles :)
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
05-02-2006 16:11
Well, follow_source disables burst_radius, so no setting of burst_radius has any effect in that case.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
05-02-2006 16:43
Well, found another post in feature suggestions that suggests this, so it isn't currently possible, apparently. (see "Swirling Vortexes of Particles";)

Anyway, thanks for the suggestions. Glad to know I wasn't as much an idiot here as I normally am. ;)
Neb Soyer
Really good looking.
Join date: 9 Apr 2006
Posts: 45
05-03-2006 05:09
If you set the particle pattern to ANGLE, and set the omega to <0,0,1> that usually spins the particles around the object. I believe that it can depend upon quite a few factors, like object rotation, inner/outer angles..etc.

I made this for you to look at, I used it on a default Box and a default Sphere with no changed rotation, and it made the particle spin around it:

CODE
particles()
{
// mask flags - set to TRUE (or 1) to enable
integer glow = 1; // Make the particles glow
integer bounce = 1; // Make particles bounce on Z plane of object
integer interpColor = 1; // Go from start to end color
integer interpSize = 1; // Go from start to end size
integer wind = 0; // Particles effected by wind
integer followSource = 1; // Particles follow the source
integer followVel = 1; // Particles turn to velocity direction

//pattern:
//integer pattern = PSYS_SRC_PATTERN_EXPLODE
//integer pattern = PSYS_SRC_PATTERN_DROP
//integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY
//integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE
//integer pattern = PSYS_SRC_PATTERN_ANGLE
integer pattern = PSYS_SRC_PATTERN_ANGLE;

// Select a target for particles to go towards
// "" for no target, "owner" will follow object owner
// and "self" will target this object
// or put the key of an object for particles to go to
//key target = "";
key target = "";
//key target = "owner";

// particle parameters
float age = 3; // Life of each particle
float maxSpeed = 1; // Max speed each particle is spit out at
float minSpeed = 1; // Min speed each particle is spit out at
string texture = ""; // Texture used for particles, default used if blank
float startAlpha = 1; // Start alpha (transparency) value
float endAlpha = 1; // End alpha (transparency) value (if interpColor = TRUE)
vector startColor = <1,1,1>; // Start color of particles <R,G,B>
vector endColor = <0,0,0>; // End color of particles <R,G,B> (if interpColor = TRUE)
vector startSize = <0.1,0.1,0.1>; // Start size of particles
vector endSize = <0.1,0.1,0.1>; // End size of particles (if interpSize == TRUE)
vector push = <0,0,0>; // Force pushed on particles

// system parameters
float rate = 0.01; // How fast (rate) to emit particles
float radius = 0; // Radius to emit particles for BURST pattern
integer count = 25; // How many particles to emit per BURST
float outerAngle = 0; // Outer angle for all ANGLE patterns
float innerAngle = 0; // Inner angle for all ANGLE patterns
vector omega = <0,0,1>; // Rotation of ANGLE patterns around the source
float life = 0; // Life in seconds for the system to make particles

integer flags = 0;

if (target == "owner") target = llGetOwner();
if (target == "self") target = llGetKey();
if (glow) flags = flags | PSYS_PART_EMISSIVE_MASK;
if (bounce) flags = flags | PSYS_PART_BOUNCE_MASK;
if (interpColor) flags = flags | PSYS_PART_INTERP_COLOR_MASK;
if (interpSize) flags = flags | PSYS_PART_INTERP_SCALE_MASK;
if (wind) flags = flags | PSYS_PART_WIND_MASK;
if (followSource) flags = flags | PSYS_PART_FOLLOW_SRC_MASK;
if (followVel) flags = flags | PSYS_PART_FOLLOW_VELOCITY_MASK;
if (target != "") flags = flags | PSYS_PART_TARGET_POS_MASK;
llParticleSystem([ PSYS_PART_MAX_AGE,age,
PSYS_PART_FLAGS,flags,
PSYS_PART_START_COLOR, startColor,
PSYS_PART_END_COLOR, endColor,
PSYS_PART_START_SCALE,startSize,
PSYS_PART_END_SCALE,endSize,
PSYS_SRC_PATTERN, pattern,
PSYS_SRC_BURST_RATE,rate,
PSYS_SRC_ACCEL, push,
PSYS_SRC_BURST_PART_COUNT,count,
PSYS_SRC_BURST_RADIUS,radius,
PSYS_SRC_BURST_SPEED_MIN,minSpeed,
PSYS_SRC_BURST_SPEED_MAX,maxSpeed,
PSYS_SRC_TARGET_KEY,target,
PSYS_SRC_INNERANGLE,innerAngle,
PSYS_SRC_OUTERANGLE,outerAngle,
PSYS_SRC_OMEGA, omega,
PSYS_SRC_MAX_AGE, life,
PSYS_SRC_TEXTURE, texture,
PSYS_PART_START_ALPHA, startAlpha,
PSYS_PART_END_ALPHA, endAlpha
]);
}

default
{
on_rez(integer num)
{
llResetScript();
}

state_entry()
{
particles();
}
}
_____________________
down in the ghetto.
Kokoro Fasching
Pixie Dust and Sugar
Join date: 23 Dec 2005
Posts: 949
05-03-2006 07:07
Neb, I just tried your code on a default built box and sphere, and it just makes a stream of particles that goes straight up, no rotation at all. Not sure if perhaps I am reading your post wrong - were there any other steps to do to the box/sphere?
Neb Soyer
Really good looking.
Join date: 9 Apr 2006
Posts: 45
05-03-2006 08:25
Meh, there may be, let me just check through it.. I'll edit this post in a couple minutes from now.

EDIT - Okay, yeah, I rotated it by 90 degrees. And then it works. Sorry about that. :rolleyes:

Another Edit - I'm trying to make the particles spin around an object without having to apply any rotation to it first, it seems tricky, perhaps someone knows the right parameters to use to do so, if so, share with us.
_____________________
down in the ghetto.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
05-03-2006 10:24
Nice example, but it doesn't answer the original question. Your example is just a rotating emitter, which sprays particles out in a circle. Once sprayed, the particles move in a straight line out away from the emitter (and the object itself).

What I was looking for is some way to make the particles move in circular fashion after they are emitted. To see what I mean, create a box on the ground, then delete it (or make it say something in its touch event and touch it repeatedly). Watch the particle effect. So, I know it is possible to do as far as the client goes, but it is a hard-coded effect, not one which is possible with llParticleSystem, at least as far as anyone knows.

Thanks for trying, though! :)
Bastage Beeks
Registered User
Join date: 15 Mar 2006
Posts: 44
05-03-2006 11:13
From: Talarus Luan
Nice example, but it doesn't answer the original question. Your example is just a rotating emitter, which sprays particles out in a circle. Once sprayed, the particles move in a straight line out away from the emitter (and the object itself).

What I was looking for is some way to make the particles move in circular fashion after they are emitted. To see what I mean, create a box on the ground, then delete it (or make it say something in its touch event and touch it repeatedly). Watch the particle effect. So, I know it is possible to do as far as the client goes, but it is a hard-coded effect, not one which is possible with llParticleSystem, at least as far as anyone knows.

Thanks for trying, though! :)


Couldn't you have the follow options set so that Neb's idea would work the way you want it by having the particles follow the emitting object that's rotating around your object, that object could be made invisible.

Isn't that what these do? (not sure, I'm new to particles -in SL)

PSYS_PART_FOLLOW_SRC_MASK Particle position is relative to source object's vertical position (rotation still disperses particles); disables PSYS_SRC_BURST_RADIUS. 0x010
PSYS_PART_FOLLOW_VELOCITY_MASK rotate particles so vertical axis points towards velocity vector
Neb Soyer
Really good looking.
Join date: 9 Apr 2006
Posts: 45
05-03-2006 11:27
Particles can't be manipulated AFTER being emitted.

The way to do what you want, I'm guessing, would be to have rings around the main object, with small prims attached to the rings which when they recieve communication, they create particle effects themselves.

So in short: Have multiple prims emitting particles.

Oh and, I forgot, 'should have the rings and small prims invisible (100% transparant/alpha).
_____________________
down in the ghetto.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
05-03-2006 13:29
Bastage --

Aye, I did solve it that way a while back, but it doesn't quite look right unless the particles emit in straight lines perpendicular to the plane of rotation, and even that looks weird. Also I've looked into multiple particle emitters doing this, but it still has the problem that the particles don't really "rotate", as their orientation in world coordinates relative to the emitter does not change, except through their normal linear motion. Still not quite what I was looking for.

Neb --

Well, they CAN be manipulated a bit after emission with either the PSYS_PART_WIND_MASK, or by using PSYS_SRC_ACCEL, but those are still linear functions (though WIND can change their direction if it changes during the life of the particle, but that is not really controllable). Like I mentioned earlier, the desired effect is a swirling vortex very similar to the "talking/rezzing prim" particle effect, and it has been said elsewhere that there is no current way to do it in another thread, so I am content to wait until it does, as the workarounds don't lend a "natural" feel to the effect I am trying to achieve.

Anyway, thanks again for all your input. :)
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
05-04-2006 07:42
I've been able to get individual particles to move in a close approximation to a circle by using a combination of velocity, force, and target... they start out moving (say) north, the force pushes them west and south, and the target brings them back east again.

If you release them from an emitter that's using llTargetOmega() to orbit the center of the swirl, and give the particles themselves a matching omega, and have them targeting the emitter again, you may be able to get something close to the effect you want.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
05-04-2006 15:40
How do you give particles an omega rotation?

I see what you are saying. Would take some serious experimentation to get the exact values to make it look close to a swirling motion.