Particle Direction
by Howard Dortch · in Torque Game Engine · 07/02/2008 (11:49 am) · 13 replies
I have been trying to get my particles to go a certain direction and I have some problems.
I want the particle (smoke) to go toward +y direction. The theta are set to 85 to 95 so they follow the ground more or less.
thetaMin = 85.0;
thetaMax = 95.0;
Run the program and the particles follow the ground nice but they go -y direction.
I looked at the phi numbers but all they do is fire particles out in a spiral pattern.
How can I get my particles to go +y ? What is the magic combination of numbers ?
Thanks for any help
I want the particle (smoke) to go toward +y direction. The theta are set to 85 to 95 so they follow the ground more or less.
thetaMin = 85.0;
thetaMax = 95.0;
Run the program and the particles follow the ground nice but they go -y direction.
I looked at the phi numbers but all they do is fire particles out in a spiral pattern.
How can I get my particles to go +y ? What is the magic combination of numbers ?
Thanks for any help
#2
Thanks for the reply.
07/02/2008 (12:48 pm)
The theta values are 0 to 180 positive. 0 being straight up and 180 straight down. Its the rotation about the z axis that has me foiled.Thanks for the reply.
#3
Just the first thing that comes to mind...
No, that doesn,t work. How about phiVariance set at 180?
Tony
07/03/2008 (4:43 am)
Can you set the parameter for VELOCITY at -1?Just the first thing that comes to mind...
No, that doesn,t work. How about phiVariance set at 180?
Tony
#4
07/03/2008 (5:12 am)
Maybe a combination of phiVariance (find the value that most closely comes to the direction you need) and thetaMin/thetaMax would do the trick. Are you using the built in particle editor? Hit F5 in game and you can select and edit the particle emitter and particles and then save the output. You can find the saved file in the creator directory. The particle editor does have a few bugs and can output bogus settings, and the save feature doesn't always work, but it can save you time from editing the scripts by hand and having to restart in order to see changes.
#5
Still need to force the particle to travel at compas heading 45 (or whatever)
07/03/2008 (5:47 am)
The phiVariance sets the dispersion angle of the particle. In other words if you set it to 90 then the puffs of smoke would be from 0 to 90 degrees random. I wouldn't mind setting a dispersion of say 10 degrees but the problem still remains I can't tell the particle to emit in the direction I want. Right now I want the particles to travel + y direction. but they are traveling - y and setting the phiVariance to 180 seems to emit particles from compas 180 to compas 360 randomly.Still need to force the particle to travel at compas heading 45 (or whatever)
#6
Waitaminute...
I just placed a new particle emitter and loaded the STEAM emitter and node. When I go into the Inspector and change the rotation transform, the particles change direction.
default rotation is 1 0 0 0
change it to 1 0 0 180 (x rotation set at 180 degrees) and the particles go the other way.
Tony
07/03/2008 (10:42 am)
So, what is the purpose of the ROTATION transform if it doesn't actually control the direction of particle output?Waitaminute...
I just placed a new particle emitter and loaded the STEAM emitter and node. When I go into the Inspector and change the rotation transform, the particles change direction.
default rotation is 1 0 0 0
change it to 1 0 0 180 (x rotation set at 180 degrees) and the particles go the other way.
Tony
#7
I guess I will just have to modify the engine .... /sigh
07/03/2008 (10:47 am)
I dont know but thats the first thing I tried in the editor, grabbed the thing and rotated it. smoke still travels in -Y direction..I guess I will just have to modify the engine .... /sigh
#8
update: the datablocks for particles and emitters are all pretty similar. The ejection velocity of steam is 2 while smoke is only 0.25
Maybe if you really bump up the velocity?
Tony
07/03/2008 (10:52 am)
Well, if steam can change direction, everything should. Let me check the dtatblocks for differences and see what turns up. Maybe you just have to tweak some settings...update: the datablocks for particles and emitters are all pretty similar. The ejection velocity of steam is 2 while smoke is only 0.25
Maybe if you really bump up the velocity?
Tony
#9
07/03/2008 (11:03 am)
Yeah, rotation should do it for you. Shouldn't have to change any engine code. Have you checked your gravity variables? Maybe your gravity is set to send the particle upwards..
#10
I can't understand why...
Tony
07/03/2008 (11:26 am)
Rotation only seems to work for the STEAM emitter.I can't understand why...
Tony
#11
I set the gravity to have the smoke fall slowly
datablock ParticleData( FarmGraySmokeParticle )
{
textureName = "~/data/shapes/particles/smoke";
dragCoefficient = 0.0;
windCoefficient = 0.0;
gravityCoefficient = 0.06; << fall slowly
inheritedVelFactor = 0.00;
useInvAlpha = false;
spinRandomMin = 0.0;
spinRandomMax = 0.0;
remainder removed
}
datablock ParticleEmitterData(GraySmokeParticleEmitter )
{
particles = FarmGraySmokeParticle;
ejectionPeriodMS = 300;
periodVarianceMS = 150;
ejectionVelocity = 0.5;
velocityVariance = 0.20;
thetaMin = 85.0; // x up/down directions
thetaMax = 90.0;
phiReferenceVel = 0; //
phiVariance = 0;
orientParticles = false;
};
In the mission I have this:
new ParticleEmitterNode(farmsmoke) {
canSaveDynamicFields = "1";
position = "90.8393 33.0143 69.3621";
rotation = "0 0 1 180"; <<<<<<<<<<<< TRY TO MAKE IT GO +Y but it wont. "0 0 1 0" dont work
scale = "1 1 1";
dataBlock = "GraySmokeParticleEmitterNode";
emitter = "GraySmokeParticleEmitter";
velocity = "1";
};
07/03/2008 (1:34 pm)
Here is what I have, it's nothing special.I set the gravity to have the smoke fall slowly
datablock ParticleData( FarmGraySmokeParticle )
{
textureName = "~/data/shapes/particles/smoke";
dragCoefficient = 0.0;
windCoefficient = 0.0;
gravityCoefficient = 0.06; << fall slowly
inheritedVelFactor = 0.00;
useInvAlpha = false;
spinRandomMin = 0.0;
spinRandomMax = 0.0;
remainder removed
}
datablock ParticleEmitterData(GraySmokeParticleEmitter )
{
particles = FarmGraySmokeParticle;
ejectionPeriodMS = 300;
periodVarianceMS = 150;
ejectionVelocity = 0.5;
velocityVariance = 0.20;
thetaMin = 85.0; // x up/down directions
thetaMax = 90.0;
phiReferenceVel = 0; //
phiVariance = 0;
orientParticles = false;
};
In the mission I have this:
new ParticleEmitterNode(farmsmoke) {
canSaveDynamicFields = "1";
position = "90.8393 33.0143 69.3621";
rotation = "0 0 1 180"; <<<<<<<<<<<< TRY TO MAKE IT GO +Y but it wont. "0 0 1 0" dont work
scale = "1 1 1";
dataBlock = "GraySmokeParticleEmitterNode";
emitter = "GraySmokeParticleEmitter";
velocity = "1";
};
#12
Seems you have to declare the theta as 0 to some value ( in my case I wanted to constrain the spread to a direction) then set the phi data to 0 and THEN rotate it to the direction you want. I was trying to set the direction from the object instead of make it go z and then rotate to + Y like I wanted.
Thanks all for the help.....
07/03/2008 (1:56 pm)
Well I got it to work I think it was gimble locked.Seems you have to declare the theta as 0 to some value ( in my case I wanted to constrain the spread to a direction) then set the phi data to 0 and THEN rotate it to the direction you want. I was trying to set the direction from the object instead of make it go z and then rotate to + Y like I wanted.
Thanks all for the help.....
Torque 3D Owner Morrock