Kugelförmiger Partikeleffekt

Posted By: NeoJones

Kugelförmiger Partikeleffekt - 05/24/14 11:06

Hi! Ich würde gerne folgenden Partikeleffekt realisieren:

Eiskristall Partikeleffekt (YouTube)

Partikel in Kreisbewegung und negativer z-achse ist kein Problem, aber dieses exponentiale, das es aussieht wie eine Kugel.
Hat da jemand nen Codeschnipsel oder kann mir da weiterhelfen?
Posted By: pararealist

Re: Kugelförmiger Partikeleffekt - 05/24/14 11:11

Check AUM
http://www.opserver.de/coni_users/web_users/pirvu/aum/aumonline_e/index.html
there is a circle particle code shown on page.

here too.
http://www.opserver.de/coni_users/web_users/pirvu/aum/aumonline_e/index.html
Posted By: NeoJones

Re: Kugelförmiger Partikeleffekt - 05/24/14 11:19

Yes, but its only a circle. The movie that i have uploaded shows the effect, what iam looking for.
Posted By: NeoJones

Re: Kugelförmiger Partikeleffekt - 05/24/14 15:33

I really dont know, how can I do that...
Posted By: NeoJones

Re: Kugelförmiger Partikeleffekt - 05/25/14 09:49

Hat da echt keiner ne Ahnung?? Ich habs schon mit cos und sin versucht. Die Alternative wäre eine unsichtbare Kugel mit einer animierten Textur, welche sich dann dreht, aber die Animation säh dann immer gleich aus und im Video kann man ganz klar erkennen, das die Bewegung der einzelnen Partikel zufällig verläuft.
Posted By: Superku

Re: Kugelförmiger Partikeleffekt - 05/25/14 09:59

Using sine and cosine is the correct approach, have a look here: http://de.wikipedia.org/wiki/Kugelkoordinaten
You just need an additional angle:



Posted By: NeoJones

Re: Kugelförmiger Partikeleffekt - 05/25/14 10:37

Here is what I have:
Code:
var radius = 5;
function remove_bees(PARTICLE *p)
{
  p->vel_x = actor.x - (radius * sin(p.lifespan)*cos(p.lifespan));
  p->vel_y = actor.y + (radius * sin(p.lifespan)*sin(p.lifespan));
  p->vel_z = radius * cos(p.lifespan);
  p.lifespan -= 10 * time_step;
}
 
function swarm_init(PARTICLE *p)
{
  p.lifespan = 360;
  p.alpha = 100;
  p.bmap = snow_map;
  p.size = 2;
  p.flags = MOVE;
  p.event = remove_bees;
}
 
function swarm()
{
  while(actor == NULL) {wait (1);}
  while (1)
  {
     effect(swarm_init, 1, vector(actor.x, actor.y, actor.z+45), normal);
     wait(3);
  }
}


But it looks like this:



Any ideas?
Posted By: Ch40zzC0d3r

Re: Kugelförmiger Partikeleffekt - 05/25/14 10:54

Im sure you want to use cosv, sinv, tanv in degree and not radians grin
Posted By: Jog

Re: Kugelförmiger Partikeleffekt - 05/25/14 10:54

Hallo
Versuch es mal damit wahrscheinlich hast du das gemeint.


function keep_particle(PARTICLE *p)

{

p.lifespan = 100; // use a big value here

}



function particle_effect(PARTICLE *p)

{

// p.bmap = particle_tga;

p.size = 2; // gives the size of the particles

p.flags |= BRIGHT ;

p.event = keep_particle;

}



action sphere() // attach this action to a sphere model

{

set (my, PASSABLE | INVISIBLE );

var particle_pos[3];

while (my.skill1 < ent_vertices (my))

{

my.skill1 += 1;

vec_for_vertex(particle_pos, my, my.skill1);
// wait(-0.001);

effect(particle_effect, 1, particle_pos, nullvector);

}




}

Gruß Jog
Posted By: NeoJones

Re: Kugelförmiger Partikeleffekt - 05/25/14 11:13

Originally Posted By: Ch40zzC0d3r
Im sure you want to use cosv, sinv, tanv in degree and not radians grin

Oh, yes you're right! grin

But it still looks like everything and not the way it should be cry
Posted By: Jog

Re: Kugelförmiger Partikeleffekt - 05/25/14 11:52

Hallo


Der Vorschlag den ich gepostet habe kann auch Animiert werden, so dass alle Vertices durchlaufen werden und die Kugel mit
Partikel gezeichnet wird.

Gruß Jog
Posted By: pararealist

Re: Kugelförmiger Partikeleffekt - 05/25/14 12:09

Sorry link did not take you where you should go.
The particle sphere code (among others)is in aum64code\workshop39.
This looks to be what you want.
Posted By: NeoJones

Re: Kugelförmiger Partikeleffekt - 05/25/14 12:45

Originally Posted By: pararealist
Sorry link did not take you where you should go.
The particle sphere code (among others)is in aum64code\workshop39.
This looks to be what you want.

Thanks for your reply. I was looking at that, but its not that what I want. This is a sphere generates the particle on each vertex and the sphere rotate. I want a point over the actor as emitter and the particles falling from this point with 2 rotations to the ground. Sorry for my bad english.

Originally Posted By: Jog
Der Vorschlag den ich gepostet habe kann auch Animiert werden, so dass alle Vertices durchlaufen werden und die Kugel mit
Partikel gezeichnet wird.


Danke für deine Antwort, aber ich möchte die Kugel nicht "zeichnen". Der Emitter ist oberhalb meines Players an einem Punkt und von dort sollen die Partikel generiert werden. Oder hab ich da was falsch verstanden?
Posted By: Superku

Re: Kugelförmiger Partikeleffekt - 05/25/14 13:55

Originally Posted By: Superku
You just need an additional angle:
Posted By: Jog

Re: Kugelförmiger Partikeleffekt - 05/25/14 14:11

Hallo


Hier ein abgeänderter Code der natürlich nur minimalistich ist um zu sehen was gemeint ist.
Wenn du die Kugel so platzierst das der Player sich in ihr befindet werden Partikel von oben nach unten generiert.
Die Kugel muss so ausgerichtet sein das der erste Vertices sich oben befindet.
Durch anpassen der Partikelparameter kann man sich den Effekt natürlich selbst einstellen.
Je mehr Vertices die Kugel hat um so besser.


function keep_particle(PARTICLE *p)

{



p.alpha -= 2*time_step;
// p.size +=0.5*time_step;
if (p.alpha <= 0) p.lifespan = 0;

}



function particle_effect(PARTICLE *p)

{

// p.bmap = particle_tga;

p.size = 2; // gives the size of the particles

p.flags |= BRIGHT ;

p.event = keep_particle;

}



action sphere() // attach this action to a sphere model

{

set (my, PASSABLE | INVISIBLE );

var particle_pos[3];

while (my.skill1 < ent_vertices (my))

{

my.skill1 += 1;

vec_for_vertex(particle_pos, my, my.skill1);
wait(-0.0001);

effect(particle_effect, 1, particle_pos, nullvector);

}




}

Gruß Jog
Posted By: NeoJones

Re: Kugelförmiger Partikeleffekt - 05/25/14 15:09

Danke Jog, ich denke so mach ichs auch laugh
Posted By: Jog

Re: Kugelförmiger Partikeleffekt - 05/25/14 15:49

Hallo

Freud mich das ich ein wenig helfen konnte.


Gruß Jog
Posted By: NeoJones

Re: Kugelförmiger Partikeleffekt - 05/25/14 19:09

Jog, das funktioniert soweit schon ganz gut, ist allerdings etwas getrickst. Klar, je mehr Vertices, desto besser sieht es aus.:D
Nun hat vorhin jemand aus einem Mathe Forum den Begriff Loxodrome genannt und das ist genau das, was ich brauche:

http://de.wikipedia.org/wiki/Loxodrome

Will mal versuchen, die Formel in Lite-C zu bekommen. laugh
Posted By: NeoJones

Re: Kugelförmiger Partikeleffekt - 05/26/14 07:02

So, falls es noch jemand interessiert... Habe es jetzt so gemacht und es funktioniert wunderbar:

Code:
var radius = 40;

function particle_move(PARTICLE *p)
{	
	p.x = radius * sinv((p.lifespan/2)) * cosv(p.lifespan+p.skill_a);
	p.y = radius * sinv((p.lifespan/2)) * sinv(p.lifespan+p.skill_a);
	p.z = -radius * cosv((p.lifespan/2))+42;
	p.lifespan -= p.skill_b * time_step;
}
 
function particle_init(PARTICLE *p)
{
	p.lifespan = 360;
	p.alpha = 40+random(60);
	p.bmap = snow_map;
	p.size = 1+random(3);
	p.vel_x = 0;
	p.vel_y = 0;
	p.vel_z = 0;
	p.flags = MOVE;
	p.event = particle_move;
	p.skill_a = random(360);
	p.skill_b = 1+random(3);
}
 
function create_particle()
{
  while(actor == NULL) {wait (1);}
  while(1)
  {
     effect(particle_init, 1, vector(actor.x, actor.y, actor.z+45), normal);
     wait(1);
  }
}

© 2024 lite-C Forums