Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Dynamics & Special Effects (https://simplymaya.com/forum/forumdisplay.php?f=33)
-   -   Galaxy Collision simulation (https://simplymaya.com/forum/showthread.php?t=12186)

Markuz 10-06-2004 11:58 AM

Galaxy Collision simulation
 
Hi!

http://www.realitydiluted.com/mirror.../galaxies.html

Upon this article (not really a tutorial) I want to create a galaxy collision simulation with the maya particles and force fields, but I have no idea how to create particles in form so that they look like a spiral galaxy (see article pictures)? The particle have to be one particle object, so creating them individually with a mel script won't work, right?

Maybe I should first create a thousands-particle object and then position them by an expression with poses them randomly on a spiral path and then add a random-3d-correction?? Any idea how to do that?

Any Idea how I could create a galaxy with 3 spiraling arms of particles?

Thanks for any help and advice!,

Markuz :)

Markuz 10-06-2004 02:32 PM

Hi!

Ok, hab jetzt die Partikel schön als Galaxie angeordnet. Habe dazu einfach einen Emitter und ein Vortex Field genommen um anschließend nach 1000 Frames einen neuen Initial State zu definieren .... Hätt' ich auch vorher drauf kommen können;)

Naja, jetzt schlag ich mich gerade mit ner expression um:

vector $pos = Galaxy1_StarsS.position;
float $Dx = (abs(Galaxy1_Nuclei1.translateX) - abs($pos.x));
float $Dz = (abs(Galaxy1_Nuclei1.translateZ) - abs($pos.z));
float $r2 = $Dz*$Dz + $Dx*$Dx;
float $r = sqrt($r2)/10;
Galaxy1_StarsS.velocity = Galaxy1_StarsS.velocity + <<0,0,$r>>;

Galaxy1_Nuclei1 ist dabei mein Newton Field, und eigendlich sollte nun die Geschwindigkeit eines jeden einzelnen Partikels linear abhängig sein vom Abstand dieses Gravitationszentrums (mein Newton Field eben)... Aber leider weiß i´ch nicht, wie ich mit mel oder sonst wie diese Geschwindigkeit tangential ansetzen kann? Die letzte Zeile des scripts ist daher falsch, hier fliegen alle Partikel einfach nach rechts...

Wie also kann man diese proportionale Geschwindigkeit tangential an den gedachten Kreis um die Position meines Feldes mit dem Radius $r ansetzen?

MFG

Markuz

Markuz 10-06-2004 02:35 PM

Hi!

Ok, ich habe es jetzt über die Steigung, dann über Tan den Winkel, dann über sin bzw. cos die X- und Z-Geschwindigkeitskomponente berechnet... funzt allerdings noch immer nicht:(

Hab ich etwas bei meinen Berechnungen falsch gemacht? (siehe skizze)

http://markus1986.tripod.com/GalaxyProb.JPG

vector $pos = Galaxy1_StarsS.position;
float $Dx = (abs(Galaxy1_Nuclei1.translateX) - abs($pos.x));
float $Dz = (abs(Galaxy1_Nuclei1.translateZ) - abs($pos.z));
float $r2 = $Dz*$Dz + $Dx*$Dx;
float $r = sqrt($r2);

float $rmx = $r*$r - $pos.x*$pos.x;
float $Steigung = (-1)*$pos.x/(sqrt($rmx));
float $alpha = atan($Steigung);
int $k = 1;
float $Vx = cos($alpha)*$k*$r;
float $Vz = sin($alpha)*$k*$r;


Galaxy1_StarsS.velocity = Galaxy1_StarsS.velocity + <<$Vx,0,$Vz>>;

MFG und Danke für jede Hilfe!

Markuz


All times are GMT. The time now is 02:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018