Jump to content
Sign in to follow this  
Halltom92

Random pop bounce direction

Recommended Posts

Hi,

I'm trying to achieve a simple effect, but am struggling to get my head around it. I'm sure I'm overthinking it but if anyone could help me that would be great! I'm trying to get a random bounce direction on particles when the collide with the ground plane. As if the particles were small stones bouncing randomly due to a bumpy road surface. I've attached a hip file with the basic setup. I was thinking maybe you could inherit a random vector as the collision happens, but couldn't seem to figure a way to do it. I know various sources have mentioned the old "gain normal" parameter, but this no longer exists.

Any help would be much appreciated.

odforce_randompopdirection.hip

Share this post


Link to post
Share on other sites

Hmm, good challenge. I assumed there'd be a pops node or attribute to do this, but I couldn't see it. I did it in the end with a wrangle that detects when a collision has happened, and adds a random vector to @v. To keep the system from exploding I set a maximum number of bounces, and scale this extra random vector down after each collision, then forces v to 0 after that max bounce count has been reached (otherwise you get that annoying pops jitter when the particles are meant to have come to rest).

Would be curious if anyone else has a cleaner way to do this.

pop_rand_bounce.hip

  • Like 1

Share this post


Link to post
Share on other sites

I thought I'd try looking inside the Pop Solver itself to see where it constructs the collision normal. Couldn't find any method to modify it on the fly. In doing that I started messing around with the mass of nodes in there to see if I could bypass the whole collision response built into the Gas Integrator in the Pop Solver and do a simple one myself. Turns out you can do that but it is probably the opposite of a 'cleaner way' to do the original challenge. Matt's is by far the cleanest/most explicit way I could find. Anyway, scene attached is my attempt. It is only a single Pop Wrangle inside the Pop Solver and seems to work OK. Was interesting to see how granular you could go with the built in nodes and how many you could throw away(!).

pop_rand_bounce_simple4.hipnc

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
Sign in to follow this  

×