PDA

View Full Version : Controll the random spin of particle Instaces?


aiming
07-14-2008, 01:18 PM
Hey all,

I'm building a space scene right now. It's a POV flight through a asteroid field. I realized it over a Particle field, the instancer and a little PP Array Attribute.

Under Creation it's:
Asteroiden_Gro▀Shape.RandomSpinPPBIG = rand(-1,1);

under runtime before dynamics it's:
float $spin = Asteroiden_Gro▀Shape.RandomSpinPPBIG;
Asteroiden_Gro▀Shape.BigAsteroidRotation += 0.6*$spin;

The asteroids are now spinning randomly in all 3 possible spinning directions. The result is a really strange rotation movement. It looks like a force is changing the rotation direction from time to time. In space as far as I know such a force doesn't exist, so i want to get rid of it. ;)

I'm new to Maya Dynamics and don't really know how to get the asteroids spinning in one or two directions only.

Hope my english is good enough to make you understand what's my problem. :)

greetz
Ben

CarlRiver
07-14-2008, 06:42 PM
the way I would go about this would be to create a creation expression that assigned a random spin-vector to each particle:

RandomSpinPPBig = sphrand(1);

The value in the brackets controls the speed of the rotation. Then as a runtime-before expression you could write something like this:

BigAsteroidRotation += RandomSpoinPPBig;

This should about do it and should work fine.


And a small tip: don't use non-standard characters like ▀ or ń,÷,Ř in Maya.

aiming
07-15-2008, 12:11 AM
Thank you!
I'll try it tomorrow.

greezt from Cologne
Ben

CGTalk Moderation
07-15-2008, 12:11 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.