XM Magdalena 3D print, GGeorgy (3D)
LC #42 Pipers Alley

View Full Version : Particle instances Rotation Script problem

03-11-2008, 06:56 PM

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.

03-11-2008, 07: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.

03-11-2008, 07: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.

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

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