Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Particle system positioning?

Austin Blackheart
Registered User
Join date: 8 Jan 2009
Posts: 13
01-15-2009 04:37
Let me quote from lslwiki:


"Directional displays are relative to the prim's z-axis and emanate from the center of the prim."


Im not quite sure how this works. Ive got a prim with a particle script in it. I rotate it and the system does not rotate with the prim. Is it not possible to rotate particle systems?
Sounds kinda jacked up really.
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
01-15-2009 05:10
Not sure what you are seeing but I assume you are aware that only new particles will be rotated with the prim -- the ones already there will carry on doing what they were told at the time they were generated.

/esc
_____________________
http://slurl.com/secondlife/Together
Austin Blackheart
Registered User
Join date: 8 Jan 2009
Posts: 13
01-15-2009 06:09
Ok heres the deal, Ive got a hud button that summons another flat sphereical prim out infront of me 7meters based on the direction Im pointing. It will rotate it to face me.

My problem is, if Im not facing east or west I have to flip it 180 degrees from the top down. Not left or right. Thats to get it to look how its supposed to look. So why am I having to flip the prim after I summon it to get the particle effect to be normal?

Heres the rez code:

llRezObject(tp_object, llGetPos() + (<7.0, 0.0, 1.0> * llGetRot()), ZERO_VECTOR,
llGetRot(), rez_chan);
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
01-15-2009 06:57
What about flipping it with the rez call:
llRezObject(tp_object, llGetPos() + (<7.0, 0.0, 1.0> * llGetRot()), ZERO_VECTOR,
llEuler2Rot(<PI,0,0>;) * llGetRot(), rez_chan);
_____________________
http://slurl.com/secondlife/Together
Austin Blackheart
Registered User
Join date: 8 Jan 2009
Posts: 13
01-15-2009 07:17
Tryed it not workin =\

Should I be using some type of detect to get llEuler2Rot?
Austin Blackheart
Registered User
Join date: 8 Jan 2009
Posts: 13
01-15-2009 07:29
Shouldnt that be llEuler2Rot() + <0,0,0>

I know that detects compass position. I guess I just dont know how to calculate it.
Fenix Eldritch
Mostly harmless
Join date: 30 Jan 2005
Posts: 201
01-15-2009 11:39
Psys_part_follow_src_mask ?
Austin Blackheart
Registered User
Join date: 8 Jan 2009
Posts: 13
01-15-2009 12:27
I set followSource in the particle system for target and no luck. Still trying. Starting to think this problem might be in the particle system script.
Fenix Eldritch
Mostly harmless
Join date: 30 Jan 2005
Posts: 201
01-15-2009 12:36
wait, if you want the particles to shoot towards you, (I think that's what you're trying to do) can you feed the particle script your own key for a target?
Austin Blackheart
Registered User
Join date: 8 Jan 2009
Posts: 13
01-15-2009 12:37
Heres that part of the code. I tryed putting followSource into target already. As well as GetPos(), and llGetOwner().


///////////////////////////////////////////////////////
// Pattern Selection
///////////////////////////////////////////////////////
// Uncomment the pattern call you would like to use
// Drop parcles at the container objects' center
//integer pattern = PSYS_SRC_PATTERN_DROP;
// Burst pattern originating at objects' center
//integer pattern = PSYS_SRC_PATTERN_EXPLODE;
// Uses 2D angle between innerAngle and outerAngle
integer pattern = PSYS_SRC_PATTERN_ANGLE;
// Uses 3D cone spread between innerAngle and outerAngle
//integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE;
//
//integer pattern = PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY;



setParticles()
{
// Here is where to set the current target
// llGetKey() targets this script's container object
// llGetOwner() targets the owner of this script
// Feel free to insert any other valid key
target="self";
// The following block of if statements is used to construct the mask
if (colorInterpolation) effectFlags = effectFlags|PSYS_PART_INTERP_COLOR_MASK;
if (sizeInterpolation) effectFlags = effectFlags|PSYS_PART_INTERP_SCALE_MASK;
if (windEffect) effectFlags = effectFlags|PSYS_PART_WIND_MASK;
if (bounceEffect) effectFlags = effectFlags|PSYS_PART_BOUNCE_MASK;
if (followSource) effectFlags = effectFlags|PSYS_PART_FOLLOW_SRC_MASK;
if (followVelocity) effectFlags = effectFlags|PSYS_PART_FOLLOW_VELOCITY_MASK;
if (target!="";) effectFlags = effectFlags|PSYS_PART_TARGET_POS_MASK;
if (glowEffect) effectFlags = effectFlags|PSYS_PART_EMISSIVE_MASK;
//Uncomment the following selections once they've been implemented
// if (randomAcceleration) effectFlags = effectFlags|PSYS_PART_RANDOM_ACCEL_MASK;
// if (randomVelocity) effectFlags = effectFlags|PSYS_PART_RANDOM_VEL_MASK;
// if (particleTrails) effectFlags = effectFlags|PSYS_PART_TRAIL_MASK;
Austin Blackheart
Registered User
Join date: 8 Jan 2009
Posts: 13
01-15-2009 12:45
From: Fenix Eldritch
wait, if you want the particles to shoot towards you, (I think that's what you're trying to do) can you feed the particle script your own key for a target?



Hrm, I dunno if I understand. What I have it similar to a stargate portal. its a particle effect shaped like a plate. If I rotate it anywhere it turns into a ball of junk. If its aligned east or west it forms the portal just fine. I want the particle effect to be the same no matter which way I rotate the object. So yeah basically I want it to form facing me. The prim rezzes facing me. But if its not facing east or west its a ball instead of a portal.
Austin Blackheart
Registered User
Join date: 8 Jan 2009
Posts: 13
01-16-2009 01:55
After a lot of research Ive come to the conclusion that this cant be done. I dont see any function for or method to rotate a particle effect and keep it the same. Since the entire effect was developed in the original alignment. If anyone comes up with an idea lemme know. Right now it looks like Id have to develope about 4 more particle systems to cover all angles of the compass, have the script detect compass position and then summon the appropriate system based on my direction.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-16-2009 03:52
From: Austin Blackheart
llRezObject(tp_object, llGetPos() + (<7.0, 0.0, 1.0> * llGetRot()), ZERO_VECTOR, llGetRot(), rez_chan);

You do realize that this will orient the prim's axes in the same way the avatar's axes are pointed (llGetRot() from an attachment returns the avatar's rotation/orientation)? Unless you are in mouselook, your avatar's z-axis is always pointed straight up. So the prim's z-axis will point straight up, not at your avatar. If you want the particles to be emitted toward or away from your avatar, you are going to want to combine llGetRot() with a rotation of plus or minus pi/2 about the local y-axis (which points to the avatar's left). Something like:

CODE

llRezObject(
tp_object,
llGetPos() + (<7.0, 0.0, 1.0> * llGetRot()),
ZERO_VECTOR,
llAxisAngle2Rot(<0.0, 1.0, 0.0>, -PI_BY_TWO)*llGetRot(),
rez_chan);


(That's for toward your avatar. If you want away, swtich -PI_BY_TWO to simply PI_BY_TWO.)