Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Particlelle position offsetting

Naiman Broome
Registered User
Join date: 4 Aug 2007
Posts: 246
04-27-2008 03:14
Hello I made a sculpt candle with a nice flame but I would like to reduce it from the actual 2 prims , one for candle and one for the flame particles , to actually one single prim if is possible so to reduce it but when I tired the flame went inside the candle instead than on its top , is possible to solve this somehow by ofsetting the starting point of the candle flame?

If so how ? thanks a lot for any answer....
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
04-27-2008 03:44
Increasing the PSYS_SRC_BURST_RADIUS value will normally do the trick.

Cant know 100% for sure without seeing the llParticleSystem call that you are making, but 9 out of 10 times that should do it :)
_____________________
http://wiki.secondlife.com/wiki/User:debbie_Trilling
Naiman Broome
Registered User
Join date: 4 Aug 2007
Posts: 246
04-27-2008 06:24
// Particle Script 0.3
// Created by Ama Omega
// 10-10-2003

// Mask Flags - set to TRUE to enable
integer glow = TRUE; // Make the particles glow
integer bounce = FALSE; // Make particles bounce on Z plan of object
integer interpColor = TRUE; // Go from start to end color
integer interpSize = TRUE; // Go from start to end size
integer wind = FALSE; // Particles effected by wind
integer followSource = FALSE; // Particles follow the source
integer followVel = TRUE; // Particles turn to velocity direction

// Choose a pattern from the following:
// PSYS_SRC_PATTERN_EXPLODE
// PSYS_SRC_PATTERN_DROP
// PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY
// PSYS_SRC_PATTERN_ANGLE_CONE
// PSYS_SRC_PATTERN_ANGLE
integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY;

// 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 = "";

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


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

// Script variables
integer flags;

updateParticles()
{
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
{
state_entry()
{
updateParticles();
}
}

thats the one I used where should I change it?
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
04-27-2008 14:44
PSYS_SRC_BURST_RADIUS is defined in the wiki as "Specifies the distance from the emitter where particles will be created"

In the code you have posted, PSYS_SRC_BURST_RADIUS is populated in the line:

"float radius = 0.001; // Radius to emit particles for BURST pattern"

Making the value 0.001 is as near to dead-centre of the emitting object as could be wish for. And this is exactly what you are trying to avoid.

Increasing the value to, say 0.25, will cause the particle emmision to start that distance away from the centre of the object.

So change the 0.001 in this line to a value which places the flame the correct distance above the candle
_____________________
http://wiki.secondlife.com/wiki/User:debbie_Trilling
Naiman Broome
Registered User
Join date: 4 Aug 2007
Posts: 246
04-28-2008 11:52
I did edit the numbers up to 11.025 but nothing changed the particelles where starting always the same place....
Naiman Broome
Registered User
Join date: 4 Aug 2007
Posts: 246
04-29-2008 10:45
Further help?
Debbie Trilling
Our Lady of Peenemünde
Join date: 17 Oct 2006
Posts: 434
04-30-2008 01:39
Hi

As I said in the original response, "9 out of 10 times it will normally do the trick". Your code was the one out of ten! :)

Part of the reason is that the template you are using, which is quite unnecessarily complicated for such a simple (and rather uninteresting, it has be to said), effect is using PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY as a pattern. This pattern is not listed in official documentation, and so who knows what it does or, more importantly here, what the effect on the other parameters on it are.

I've written a candle flame effect for you here; added a little colour, used a more interesting texture and given the flame a little "dance". It also uses a officially documented pattern.

But, from your POV, the most important change is that you can easily adjust the starting point of the flame. Simply change the value in the line "float Radius = 0.125;" to raise or lower the starting point. You will eventually find the correct value for the size of your candle.

CODE

float Radius = 0.125;

ParticleStart()
{
llParticleSystem([
PSYS_PART_FLAGS, 0x103,
PSYS_SRC_PATTERN, 0x004,
PSYS_PART_START_ALPHA, 0.50,
PSYS_PART_END_ALPHA, 0.00,
PSYS_PART_START_COLOR, <1.00,1.00,0.00>,
PSYS_PART_END_COLOR, <1.00,0.00,0.00>,
PSYS_PART_START_SCALE, <0.06,0.12,0.00>,
PSYS_PART_END_SCALE, <0.01,0.01,0.00>,
PSYS_PART_MAX_AGE, 0.70,
PSYS_SRC_MAX_AGE, 0.00,
PSYS_SRC_ACCEL, <0.00,0.00,0.04>,
PSYS_SRC_ANGLE_BEGIN, 0.00,
PSYS_SRC_ANGLE_END, 0.09,
PSYS_SRC_BURST_PART_COUNT, 1,
PSYS_SRC_BURST_RADIUS, Radius,
PSYS_SRC_BURST_RATE, 0.05,
PSYS_SRC_BURST_SPEED_MIN, 0.09,
PSYS_SRC_BURST_SPEED_MAX, 0.13,
PSYS_SRC_OMEGA, <0.00,0.00,0.00>,
PSYS_SRC_TEXTURE, "b708e484-aeef-8cc9-3896-dd661d4e6807"
]);

}
default
{
state_entry()
{
ParticleStart();
}
}
_____________________
http://wiki.secondlife.com/wiki/User:debbie_Trilling
Naiman Broome
Registered User
Join date: 4 Aug 2007
Posts: 246
05-01-2008 03:16
Thankyou a lot... I was using a sample fromthe scripting library i edited , iwas already using a dif texture .... i will try this one as soon as I can ... :) ....
electroRogue Fizzle
Registered User
Join date: 16 Jun 2008
Posts: 37
path cut
09-02-2008 23:22
path cut begin / end of the prim also could fool the particle into thinking the middle of the prim is the edge.