Jump to content

Random pop bounce direction


Halltom92

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

Link to comment
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
Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...