Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (dBc, clonman, TipmyPip, 1 invisible), 19,019 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Why is my particle beam not rotating when it's emitter rotates? #235072
11/05/08 20:13
11/05/08 20:13
Joined: May 2008
Posts: 150
Switzerland
Hitsch Offline OP
Member
Hitsch  Offline OP
Member

Joined: May 2008
Posts: 150
Switzerland
I have an entity that contains a bone and I'm emitting particles from its location, mainly downwards.

1. Now when I rotate my entity and (I think) the bone with it, the particles keep going down. I would like the particle direction to stick to the entity's vector.
Could it be the nullvector when running the effect? I couldn't get it to change so far.

2. Now my second problem is that I have an engine part that is also rotated by a bone, but it should always point down. Can I give a bone an absolute direction vector?

Thx for your help

... for 1:
Code:
function thrusterEffect_spec_fun(PARTICLE* p)
{
if(p.size > 0) { p.size -= 0.262 *time_step; }else{p.lifespan = 0; }
   my.alpha -= 20 *time_step;
   if(p.alpha < 0) { p.alpha = 0; p.lifespan = 0; }
}

function thrusterEffect_variables(PARTICLE* p)
{
	

    p.blue = 128 ;
    p.green = 128 ;
    p.red = 128 ;
    p.vel_x = random( 1 ) - 1 ;
    p.vel_y = random( 1 ) - 1 ;
    p.vel_z = random( -10*Geschw );
    p.size = 5 ;
    p.alpha = 50 ;
    p.gravity = 0 ;
    set(p, BRIGHT|TRANSLUCENT|MOVE);
    p.event = thrusterEffect_spec_fun;
}


function thrusterEffect()
{
  while(1)
  {
     particleCount = 40;
     
   vec_for_bone(PartFront,my,"PartPosFront");						//setzt den Partikelursprung auf den bestimmten Bone
	vec_for_bone(PartBackL,my,"PartPosBL");							//setzt den Partikelursprung auf den bestimmten Bone
	vec_for_bone(PartBackR,my,"PartPosBR");							//setzt den Partikelursprung auf den bestimmten Bone
     
     effect(thrusterEffect_variables,maxv(1,particleCount*time_step),PartFront,nullvector);
         effect(thrusterEffect_variables,maxv(1,particleCount*time_step),PartBackL,nullvector);
				effect(thrusterEffect_variables,maxv(1,particleCount*time_step),PartBackR,nullvector);

     wait(1);
  }
}


action simplePart_action()
{
  thrusterEffect();

}


Last edited by Hitsch; 11/05/08 20:13.
Re: Why is my particle beam not rotating when it's emitter rotates? [Re: Hitsch] #235086
11/05/08 21:39
11/05/08 21:39
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
1. The particles will of course go down, as you are setting their speed in the particle function. You can try a "vec_rotate(p->vel_x,your.pan);" right after the instruction p.vel_z = random(-1*Gesch);

2. No, you can't. At least as far as i know. But you can correct the angle with ent_bonerotate.


Always learn from history, to be sure you make the same mistakes again...
Re: Why is my particle beam not rotating when it's emitter rotates? [Re: Uhrwerk] #235096
11/05/08 22:23
11/05/08 22:23
Joined: May 2008
Posts: 150
Switzerland
Hitsch Offline OP
Member
Hitsch  Offline OP
Member

Joined: May 2008
Posts: 150
Switzerland
Thx Uhrwerk!

That's exactly what I was looking for. I just couldn't find the commands.
I'm still trying on my second problem, but I think it will work eventually by just constantly rotating the bone in the opposite direction. Which is what you recommended if I'm right.

Cheers


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1