Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

PSYS_SRC_OMEGA in particle scripts

Rubee Adelaide
Registered User
Join date: 2 Oct 2006
Posts: 15
08-09-2007 17:13
This script doesn't behave the way I think it should.

I am trying to produce 4 particles in a ring around the prim if you look at the prim from above. For example, if it were a clock, there would be a particle at 12:00, 3:00, 6:00, and 9:00. I thought I could accomplish that by setting the PSYS_SRC_OMEGA to 90 degrees.

But instead of having a particle at each quarter of the circle, the particles are appearing at semi-random angles. What am I doing wrong?

llParticleSystem([
PSYS_PART_FLAGS, flags,

PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE,
PSYS_SRC_ANGLE_BEGIN, PI_BY_TWO,

PSYS_PART_START_SCALE, <0.2, 0.2, 0.0>,
PSYS_PART_START_COLOR, <1.0, 1.0, 1.0>,
PSYS_PART_START_ALPHA, 1.0,
PSYS_SRC_OMEGA, <0.0, 0.0, PI_BY_TWO>,

PSYS_PART_MAX_AGE, 4.0,
PSYS_SRC_BURST_RATE, 1.0,
PSYS_SRC_BURST_PART_COUNT, 1,

PSYS_SRC_BURST_SPEED_MIN, 0.0,
PSYS_SRC_BURST_SPEED_MAX, 0.0,

PSYS_SRC_BURST_RADIUS, 0.65
] );


Where flags is set like this:
flags = 0 | PSYS_PART_EMISSIVE_MASK ;
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
08-10-2007 01:19
The particles will be random in a burst, PSYS_SRC_OMEGA will rotate the source between bursts (well, it's constantly moving but for each burst you get one source angle).
From www.lslwiki.net:
From: http://lslwiki.net/lslwiki/wakka.php?wakka=llParticleSystem
PSYS_SRC_OMEGA | vector | rotation between bursts (in radians) (used only by SRC_PATTERN_ANGLE* patterns)


You wouldn't be able to notice the rotation as you're generating a ring and rotating perpendicular to it, if you change to <PI_BY_TWO,0,0> you'll see how this works.
_____________________
www.nandnerd.info
http://ordinalmalaprop.com/forum - Ordinal Malaprop's Scripting Forum
Rubee Adelaide
Registered User
Join date: 2 Oct 2006
Posts: 15
08-11-2007 19:07
Thanks for the reply, nand! I tried rotating about a different axis, but the PSYS_SRC_OMEGA still doesn't do what I expect.

Whether I set it to <PI_BY_TWO, 0.0, 0.0> or <0.0, 0.0, PI_BY_TWO>, the rotation between bursts is not even close to 90 degrees. I have tried changing the omega to different values, but the amount of rotation is always much, much smaller than the angle I choose.

Is PSYS_SRC_OMEGA broken? Or am I not understanding something about the angle?
Jotheph Nemeth
Registered User
Join date: 9 Aug 2007
Posts: 142
08-12-2007 01:04
From: Rubee Adelaide
Thanks for the reply, nand! I tried rotating about a different axis, but the PSYS_SRC_OMEGA still doesn't do what I expect.

Whether I set it to <PI_BY_TWO, 0.0, 0.0> or <0.0, 0.0, PI_BY_TWO>, the rotation between bursts is not even close to 90 degrees. I have tried changing the omega to different values, but the amount of rotation is always much, much smaller than the angle I choose.

Is PSYS_SRC_OMEGA broken? Or am I not understanding something about the angle?


I could be wrong, but doesn't PSYS_SRC_ANGLE_BEGIN, PI_BY_TWO, just specify to make the particles at 90 degrees down from the top? They would just appear at random locations around the circle then, which is what you're seeing.

0 degrees would be the top of the object, 180 degrees would be the bottom of the object.

I think the only way you'll be able to get particles to emit from 4 discrete positions may be to have 4 emitters.
Rubee Adelaide
Registered User
Join date: 2 Oct 2006
Posts: 15
08-12-2007 11:28
I was able to create particles in 2 discrete positions by setting the start and end angles the same and using PSYS_SRC_PATTERN_ANGLE.

So, if I can rotate the 2 points by 90 degrees, then I should get 4 points! However, I cannot get the emitter to rotate by 90 degrees, no matter what I set the PSYS_SRC_OMEGA to.

I was hoping that I just didn't understand the omega properly, but it seems like it doesn't work as advertised.

So I'll move on to Plan B: maybe I can turn 2 points into 4 by rotating the prim instead of using the particle omega.

Here is how I was able to get particles to appear at only 2 points:

llParticleSystem([
PSYS_PART_FLAGS, 0 | PSYS_PART_EMISSIVE_MASK,

PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE,
PSYS_SRC_ANGLE_BEGIN, PI_BY_TWO,
PSYS_SRC_ANGLE_END, PI_BY_TWO,
PSYS_SRC_OMEGA, <0.0, 0.0, 0.0>,

PSYS_PART_START_SCALE, <0.2, 0.2, 0.0>,
PSYS_PART_START_COLOR, <1.0, 1.0, 1.0>,
PSYS_PART_START_ALPHA, 1.0,

PSYS_PART_MAX_AGE, 4.0,
PSYS_SRC_BURST_RATE, 1.0,
PSYS_SRC_BURST_PART_COUNT, 2,

PSYS_SRC_BURST_SPEED_MIN, 0.0,
PSYS_SRC_BURST_SPEED_MAX, 0.0,

PSYS_SRC_BURST_RADIUS, 0.65
] );
Jotheph Nemeth
Registered User
Join date: 9 Aug 2007
Posts: 142
08-12-2007 12:57
From: Rubee Adelaide
I was able to create particles in 2 discrete positions by setting the start and end angles the same and using PSYS_SRC_PATTERN_ANGLE.

So, if I can rotate the 2 points by 90 degrees, then I should get 4 points! However, I cannot get the emitter to rotate by 90 degrees, no matter what I set the PSYS_SRC_OMEGA to.

I was hoping that I just didn't understand the omega properly, but it seems like it doesn't work as advertised.

So I'll move on to Plan B: maybe I can turn 2 points into 4 by rotating the prim instead of using the particle omega.

Here is how I was able to get particles to appear at only 2 points:

llParticleSystem([
PSYS_PART_FLAGS, 0 | PSYS_PART_EMISSIVE_MASK,

PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE,
PSYS_SRC_ANGLE_BEGIN, PI_BY_TWO,
PSYS_SRC_ANGLE_END, PI_BY_TWO,
PSYS_SRC_OMEGA, <0.0, 0.0, 0.0>,

PSYS_PART_START_SCALE, <0.2, 0.2, 0.0>,
PSYS_PART_START_COLOR, <1.0, 1.0, 1.0>,
PSYS_PART_START_ALPHA, 1.0,

PSYS_PART_MAX_AGE, 4.0,
PSYS_SRC_BURST_RATE, 1.0,
PSYS_SRC_BURST_PART_COUNT, 2,

PSYS_SRC_BURST_SPEED_MIN, 0.0,
PSYS_SRC_BURST_SPEED_MAX, 0.0,

PSYS_SRC_BURST_RADIUS, 0.65
] );


Interesting. I'll have to try it to see it. I'm also curious if changing the PSYS_SRC_BURST_PART_COUNT would affect the location too.

But the omega just tells the particle system how the particles should move, not where they are emitted from.