Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Forcing particles to (appear to) emit on another axis

Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
02-23-2008 03:27
Here's an interesting problem to mull over with your morning coffee....

Take a default cube and set the x-rotation to 270 degree. Pop the script below into it and touch to initiate the particle emission. It is a very quick effect, less than 0.15 seconds, and is almost perfect except in one crucial respect....

The smoke ring so produced (appears to) run along the y-axis but I need it to (appear to) run along the x-axis, *without* changing the rotation of the prim (that would just be too easy!)

So the cruz of the problem is, how do I get the emission to *appear as if* the x-axis was set to zero degrees and the z-axis to 90 degrees, whereas they must in fact remain at 270 degrees and zero degrees, respectively?

In short, I want the exact same effect but turned 90 degrees on itself.

The script...

CODE


StartParticle()
{

llParticleSystem([
PSYS_PART_FLAGS, 0x103,
PSYS_PART_START_SCALE, <0.50,0.5,0.00>,
PSYS_PART_END_SCALE, <0.50,0.50,0.00>,
PSYS_PART_START_COLOR, <0.875,0.875,0.875>,
PSYS_PART_END_COLOR, <0.975,0.975,0.975>,
PSYS_SRC_PATTERN, 0x04,
PSYS_SRC_BURST_RATE, 1.00,
PSYS_SRC_ACCEL, <0.00,0.00, 0.80>,
PSYS_SRC_BURST_PART_COUNT, 150,
PSYS_SRC_BURST_RADIUS, 0.85,
PSYS_SRC_BURST_SPEED_MIN,2.50,
PSYS_SRC_BURST_SPEED_MAX,2.50,
PSYS_SRC_ANGLE_BEGIN,0.0,
PSYS_SRC_ANGLE_END, 3.14,
PSYS_SRC_OMEGA, <0.00,0.00,0.00>,
PSYS_PART_MAX_AGE, 0.140,
PSYS_SRC_MAX_AGE, 0.150,
PSYS_SRC_TEXTURE, "d114fcdd-8e66-5525-66c7-da5d0cd233c1",
PSYS_PART_START_ALPHA, 0.25,
PSYS_PART_END_ALPHA, 0.00
]);
}

default
{
state_entry()
{

}

touch_start(integer total_number)
{
StartParticle();
}
}
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
02-23-2008 07:37
Unfortunately there are no flags available to set the axis. I've always been forced to either rotate the prim itself or put the particles in another prim and rotate it instead.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
02-23-2008 12:51
Thanks Jesse.

Yes, these would be the solutions I'd usually employ. Unfortunately, in this case, I have no control over the rotation or orientation of the prims as these are already set-in-stone by the designer and the builder. I've have been asked only to create the particle effects for the exisitng prim structure.

I could not see a scripting solution around the problem either, and think I was hoping that someone less rotationally-challenged than me might see one. Nevermind, I'll break the news to the designer...

Thanks :)
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
02-23-2008 13:12
Rotating the x-axis in that example doesn't change anything, because the smoke ring emits in the y-z plane.

What is the effect you are trying to accomplish, and I will see if I can replicate it for ya?
Annabelle Babii
Unholier than thou
Join date: 2 Jun 2007
Posts: 1,797
02-23-2008 13:39
Contact FifthPegasus Writer inworld. He has a script that does this.
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
02-23-2008 13:49
Hi Talarus and thanks.

The prim in question is a box hollowed 95% with the x-axis rotated at 270 degree. It's size is <0.222, 0131, 0.061>. It sits at the end of a gun barrel, and the barrel itself is positioned centrally inside our prim, and thro' the hollow. This means that our prim 'slides' over the gun barrel, at its end.

The script above is (one of four) particle effects that get emitted when the gun is fired. It creates a fast, smoke-ring flash around the end of the gun barrel.

Unfortunately, the smoke-ring currently emits in such a way that it is aligned along the same axis as the barrel, whereas it should be at right-angles to it.

Hope that is enough info, but please let me know if you need more :)
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
02-23-2008 16:48
If your hollowed cube is situated so its local z-axis is parallel to the gun barrel (as it sounds), then you can use the PSYS_SRC_PATTERN_ANGLE_CONE pattern with an PSYS_SRC_ANGLE_BEGIN and PSYS_SRC_ANGLE_END of PI_BY_TWO, and you should get the desired smoke ring effect. Change the BURST_RADIUS and move both ANGLE params up and down to get the ring where you like it.
Beezle Warburton
=o.O=
Join date: 10 Nov 2006
Posts: 1,169
02-23-2008 16:53
From: Debbie Trilling
Thanks Jesse.

Yes, these would be the solutions I'd usually employ. Unfortunately, in this case, I have no control over the rotation or orientation of the prims as these are already set-in-stone by the designer and the builder. I've have been asked only to create the particle effects for the exisitng prim structure.

I could not see a scripting solution around the problem either, and think I was hoping that someone less rotationally-challenged than me might see one. Nevermind, I'll break the news to the designer...

Thanks :)


>_<

I add fx prims because of the axis problem -- very small clear spheres and any builder who won't make allowances for these should be lightly pummeled.
_____________________
Though this be madness, yet there is method in't.
-- William Shakespeare

Warburton's Whimsies:
In SL
Apez.biz
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
02-23-2008 17:54
From: Talarus Luan
then you can use the PSYS_SRC_PATTERN_ANGLE_CONE pattern with an PSYS_SRC_ANGLE_BEGIN and PSYS_SRC_ANGLE_END of PI_BY_TWO


Fabulous. Works perfect.

Thank you Talarus :)