Particle Texture "Direction"
|
Amaranthim Talon
Voyager, Seeker, Curious
Join date: 14 Nov 2006
Posts: 12,032
|
01-22-2010 11:21
I have a script someone gave me or I got thru 2egg or script me or such, that I wish to use to make particles fall slowly in a downward direction.
It works fine but for one thing--- the texture I am using, in this case a flower, needs to fall with the flower "up" and the stem "down". It does not. It falls opposite. I tried flipping my texture in Gimp and reimporting it and it still fell downwards with its 'head' facing the ground... Is there some line in the particle script that can be changed so the flower falls stem first? And please write this in the simplest terms - I am quite script illiterate.
I don't believe I can copy the script in here as I am not sure if it was written for me or if the original was a freely distributed one- or 2egg and I just had it written up ages ago.
_____________________
"Yield to temptation. It may not pass your way again. " Robert A. Heinlein  http://talonfaire.blogspot.com/ Visit Talon Faire Main: http://slurl.com/secondlife/Misto%20Presto/216/21/155- Main Store XStreets: http://tinyurl.com/6r7ayn
|
Pete Olihenge
Registered User
Join date: 9 Nov 2009
Posts: 315
|
01-22-2010 11:28
Sorry in advance if you've already checked this, but does the script refer to the texture by key or by name, and have you changed that reference ?
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
01-22-2010 11:53
You did just the right thing. There's no way to turn the texture upside down by messing with the particle parameters, so you really do have to invert it in your graphics program (GIMP) and upload it again. But of course, that's what you did. Remember, though, that particles are prim properties. Once the parameters are set, you can actually remove the script entirely and the particles will keep bubbling along happily. My guess is that you replaced the old flower texture with your new inverted one, but you didn't reset the script so the prim is still using the old texture definition.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
01-22-2010 12:15
Just in case it wasn't specified, to make particles orient based on the direction they are moving, use the PSYS_PART_FOLLOW_VELOCITY_MASK flag.
|
Amaranthim Talon
Voyager, Seeker, Curious
Join date: 14 Nov 2006
Posts: 12,032
|
01-22-2010 12:35
From: Pete Olihenge Sorry in advance if you've already checked this, but does the script refer to the texture by key or by name, and have you changed that reference ? UUID - yes I did. From: Rolig Loon You did just the right thing. There's no way to turn the texture upside down by messing with the particle parameters, so you really do have to invert it in your graphics program (GIMP) and upload it again. But of course, that's what you did. Remember, though, that particles are prim properties. Once the parameters are set, you can actually remove the script entirely and the particles will keep bubbling along happily. My guess is that you replaced the old flower texture with your new inverted one, but you didn't reset the script so the prim is still using the old texture definition. Hmm- you may be right! I do not believe I did reset it- but one thing I find quite- vexing - since it's a 50/50 chance... why upside down??? second texture i had that happen with. From: Talarus Luan Just in case it wasn't specified, to make particles orient based on the direction they are moving, use the PSYS_PART_FOLLOW_VELOCITY_MASK flag. They are going in the right direction- the problem was in the texture orientaton. I will try the resetting of the script and come back crying if it does not work. Thanks people, and Dragon.
_____________________
"Yield to temptation. It may not pass your way again. " Robert A. Heinlein  http://talonfaire.blogspot.com/ Visit Talon Faire Main: http://slurl.com/secondlife/Misto%20Presto/216/21/155- Main Store XStreets: http://tinyurl.com/6r7ayn
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
01-22-2010 12:44
From: Amaranthim Talon ...... one thing I find quite- vexing - since it's a 50/50 chance... why upside down??? second texture i had that happen with. Well, the particles are being spewed out the +Z end of the emitter. Normally, that end of the emitter points UP, and a textured particle will be oriented the same way ... UP. When you turn the emitter upside down, its +Z end points at the ground, so the particles' textures should look upside down .... unless you deliberately draw them inverted. ETA: The other way to beat the problem, of course, is to NOT turn the emitter upside down in the first place. Keep its +Z axis pointing UP but give the emitted particles a -Z velocity component so they fall to the ground as they're emitted out the top of the emitter. Then you don't have to invert the texture.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
01-22-2010 13:28
emitter facing shouldn't have any effect on image facing, just the image's native orientation and the follow velocity flag IIRC
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
01-22-2010 13:45
Really? In my naive way of thinking about it, particles are being "shot" out of the emitter the way bullets are shot out of a gun .... point first. If you turn the emitter (gun) upside down, they still come out point first ..... and thus upside down. No?
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
|
01-22-2010 14:27
From: Amaranthim Talon They are going in the right direction- the problem was in the texture orientaton.
Just to clarify, Amaranthim, PSYS_PART_FOLLOW_VELOCITY_MASK does help determine the texture orientation. As the wiki explains, From: someone When set, particles rotate to orient their "top" towards the direction of movement or emission. Otherwise, particles are always emitted based on the current rotation of the emitter What this means in practice is that if, as I think must be the case for the falling effect you describe, you've got a small negative z value in PSYS_SRC_ACCEL and have PSYS_PART_FOLLOW_VELOCITY_MASK, then the particles will obediently flip upside down as they start their descent. If, however, you comment out PSYS_PART_FOLLOW_VELOCITY_MASK, then they should retain the orientation of the rezzer, which, assuming it's pointing upwards in the first place, sounds like what you want. ETA Just to double-check, I had a play with Jopsy's basic particle script, using a texture (capital letter A) that's got a clear orientation. With PSYS_PART_FOLLOW_VELOCITY_MASK set, as in this example, they behave as Rollig describes, like bullets coming out of a gun, if you rotate the emitter (that is, turn the emitter on its side and the textures are at 90 degrees). Comment it out, and they point upwards (that is, A is always the right way up). I think Amaranthim needs to comment out PSYS_PART_FOLLOW_VELOCITY_MASK and then play with making the negative z acceleration slightly more powerful than the SYS_SRC_BURST_SPEED_MAX and _MIN values. //// You are free to use this script as you please, so long as you include this line: //** The original 'free' version of this script came from THE PARTICLE LABORATORY. **//
// Usage: Touch prim to turn particles on/off
default { state_entry() { llParticleSystem( [ PSYS_SRC_TEXTURE, "05fb8c9a-2ace-8c64-6688-9a08f535e87b", PSYS_PART_START_SCALE, <0.2, 0.2, FALSE>, PSYS_PART_END_SCALE, <0.3, 0.3, FALSE>, PSYS_PART_START_COLOR, <1.0, 1.0, 1.0>, PSYS_PART_END_COLOR, <1.0, 1.0, 1.0>, PSYS_PART_START_ALPHA, 1.0, PSYS_PART_END_ALPHA, 1.0, PSYS_SRC_BURST_PART_COUNT, 1, PSYS_SRC_BURST_RATE, .5, PSYS_PART_MAX_AGE, 1.3, PSYS_SRC_MAX_AGE, 0.0, PSYS_SRC_PATTERN, 4, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=ANGLE_CONE, PSYS_SRC_BURST_SPEED_MIN, 1.0, PSYS_SRC_BURST_SPEED_MAX,1.0, PSYS_SRC_BURST_RADIUS, 0.0, PSYS_SRC_ANGLE_BEGIN, 0.0*PI, PSYS_SRC_ANGLE_END, 0.0*PI, PSYS_SRC_OMEGA, < 0.0, 0.0, 0.0 >, PSYS_SRC_ACCEL, < 0.0, 0.0, 0.0 >, // PSYS_SRC_TARGET_KEY, llGetLinkKey( LINK_ROOT ), PSYS_PART_FLAGS, ( 0 | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK | PSYS_PART_EMISSIVE_MASK | PSYS_PART_FOLLOW_VELOCITY_MASK // | PSYS_PART_WIND_MASK // | PSYS_PART_BOUNCE_MASK // | PSYS_PART_FOLLOW_SRC_MASK // | PSYS_PART_TARGET_POS_MASK // | PSYS_PART_TARGET_LINEAR_MASK ) ] ); } touch_start(integer n) { state particles_off; } state_exit() { llParticleSystem( [ ] ); } }
state particles_off { touch_start(integer n) { llResetScript(); } }
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
01-22-2010 14:57
Yep, that is not correct, though. :-/
Without that flag, particles are emitted oriented orthogonally with the viewer's axis, with the exception of looking up/down at them, where a 3D parallax illusion is employed.
I've edited the wiki to fix that error.
|
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
|
01-22-2010 15:14
I think we're at cross-purposes. I'm not talking about how the particles are emitted but how the texture is oriented. Without the flag, the letter A as it comes out of my emitter is always the "right way up" in that it's the same way up as it is on this page, even if I angle the emitter so the particles are travelling parallel to the ground.
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
01-22-2010 15:33
From: Innula Zenovka I think we're at cross-purposes. I'm not talking about how the particles are emitted but how the texture is oriented. Without the flag, the letter A as it comes out of my emitter is always the "right way up" in that it's the same way up as it is on this page, even if I angle the emitter so the particles are travelling parallel to the ground. I know, the message sequence was garbled; I should have quoted what I was referring to, but I started writing that message and left it in the editor whilst I checked it, then corrected it and posted, where you had posted yours in the meantime. It highlighted an error that went all the way back to the original version of the Wiki article as I wrote it, which is why I went back and changed the wiki, too. Apologies for the confusion.
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
01-22-2010 15:40
From: Rolig Loon Really? In my naive way of thinking about it, particles are being "shot" out of the emitter the way bullets are shot out of a gun .... point first. If you turn the emitter (gun) upside down, they still come out point first ..... and thus upside down. No? if they follow velocity that's true... otherwise the stick to a static orientation. in other words it's reversed from what many would see as the normal logical default, of following a path unless told otherwise. ETA: the reason the logic is reversed is that it's easier (and quicker) in graphics terms to display a default orientation, than it is to calculate its orientation to a given path, because the image is sent in a static orientation and would have to be rotated for a path.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
01-22-2010 15:45
Ah.... good. For a minute there, I was confused too. It looks as if my original perception of the problem was right, although you two have explained it more eloquently than I did.  ETA: And Void, yes, you're right. This is the reverse of the "default" logic that we would normally expect.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Amaranthim Talon
Voyager, Seeker, Curious
Join date: 14 Nov 2006
Posts: 12,032
|
01-22-2010 17:09
From: Innula ....I think Amaranthim needs to comment out PSYS_PART_FOLLOW_VELOCITY_MASK... That did it!!! Woohoo it's facing the right direction now - yay!! Thank you - You are so my hero!! Erm - Heroine 
_____________________
"Yield to temptation. It may not pass your way again. " Robert A. Heinlein  http://talonfaire.blogspot.com/ Visit Talon Faire Main: http://slurl.com/secondlife/Misto%20Presto/216/21/155- Main Store XStreets: http://tinyurl.com/6r7ayn
|