I need help with some particle effects...
Blitz3D Forums/Blitz3D Beginners Area/I need help with some particle effects...
| ||
I have created a small ship, and then added two pivots(in blitz) as children to this mesh, and am using the pivots as spawn points for engine effects.....looks nice so long as the ship is moving forward. But when i try to add reverse thurst to it... ie add motion to the particles instead of letting them just drop, i run into this problem of particles always whanting to go in 1 direction regardless of the ship oreintation. The particles are sprites, and im not sure how to get there yaw angle to match the yaw angle of the ship that they are coming from.... which means i can't get them to "flow" in the right direction with moveentity. Has anyone faced this problem ? |
| ||
rotate particle,entitypitch(pivot,true),entityyaw(pivot,true),entityroll(pivot,true) You might need to do a +180 on one of these to make it face backwards. |
| ||
You could also use TFORMNORMAL 0,0,-1,ship_mesh,0 Then tformedx() etc.. multiplied by a coefficient of your choice will give you the velocity vectors that the particle should move off at. Maybe an idea to add a bit of variance in the angle the flames come out at otherwise it would look a bit naff. Try using something like TFORMNORMAL rnd(-.5,.5),0,-1,ship_mesh,0. You may not then need the 2 x pivots. Eh .. Just noticed your using Moveentity - you'd have to use translateentity for this to work correctly. |
| ||
hehe... i think i understand robs suggestion, but im not really sure what you are suggesting stevie.... i will try robs idea, and if that don't work, i will come back to you :) as i have not really used tform on anything, and am curious as to how to use it. |
| ||
ok... this did the trick For a=1 To s\noe tmpp=add_particle(EntityX(s\eobj[a],1),EntityZ(s\eobj[a],1),s\et,b#) ;b# stands for burn...it is actually the speed the particle will be moving once created. RotateEntity tmpp,0,EntityYaw(s\shiph),0 Next I guess what i was doing wrong was not rotating the pivot each loop...assuming that blitz kept the pivots rotation locked to the parent....not letting it rotate freely. |