PDA

View Full Version : Particle instances Rotation Script problem


mnesnay
03-11-2008, 07:56 PM
Hi,

I am trying to rotate my instances in Z. I have it right now that the instances do rotate in Z but they go around in a complete circle/360 degrees. i only want the instances to go to a certain rotation in Z and then rotate back (almost like a clock pendulum - back and forth).

Any suggestions? Here's the script i'm using certainly:

Creation: particleShape1.rotPP = <<0,0,rand(-30,30)>>;

Runtime: particleShape1.rotPP += <<0,0,rand(1)>>;

Do i have to create a subtraction equation as well for the instances to rotate back and forth? Thanks.

wima
03-11-2008, 08:22 PM
Have a look at the sin function.

Creation: particleShape1.rotPP = <<0,0,rand(-30,30)>>;
Runtime: particleShape1.rotPP += <<0,0,sin(time)>>


Sin(time) will pendel(spell?) from -1 to 1 over time.

mnesnay
03-11-2008, 08:53 PM
Thanks - it is working great! Just one more question: is there a way to make each instance swing back and forth randomly? Right now they are all swinging the exact same way. Thanks.

wima
03-11-2008, 09:46 PM
Try to multiply the sin with yourParticleShape.Id or create a random attributePP to multiply with.

CGTalk Moderation
03-11-2008, 09:46 PM
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.