Jump to content

Recommended Posts

Hello all,

 

I'm rather new to Houdini and this has left me scratching my head.

 

My goal is to have a bunch of spheres moving up and down, as if they were bobbing on water.

 

I've created a field of spheres by scattering some points onto a grid and then linking a sphere into a Copy Sop. I then stamped a variable called "bobbing" with this expression: rand($PT)*sin($F*10)/3. This makes some of my spheres move more than the others.

 

My issue is that I can't manage to stop them from all starting this motion together and the sine curve kicks in for every one at the same time giving me the effect of a sound speaker playing. How do I get them to retain their current up-down animation while offsetting the start time?

 

I've tried a ForEach SOP and also a Timeshift SOP but none of them worked and I'm stumped.

 

I'd be grateful if you could offer any suggestions. 

 

I've attached the .hip file.

 

 

bouncingBalls.hipnc

Share this post


Link to post
Share on other sites

You should add a point number dependent element to the phase of the sine. At its simplest, rand($PT)*sin($F*10 + $PT)/3

  • Like 2

Share this post


Link to post
Share on other sites

You should add a point number dependent element to the phase of the sine. At its simplest, rand($PT)*sin($F*10 + $PT)/3

thank you very much eetu. I had a gut feeling it was something simple that eluded me. I did as you said and additionally multiplied it by a factor of 10 like so : rand($PT)*sin($F*10+$PT*10)/3. this creates the bouncing ball effect that i was looking for. much appreciated :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×