Making my own collision solver in VEX, but friction problem.

Recommended Posts

Hey guys, so at work, I am having some super weird particle collision issues for some reason. Here's the ways I have attempted to make the particles collide with the simple ground plane. It's like a noised up grid with sloping.

I can't share files of course.

Static object:

1. Proxy volume (sdf volume) Makes particles somehow collide with invisible ground plane the air?! Different look than the two below.

2. write and read in volume file in static solver Makes particles not follow ground well, up in air 5 inches where they are supposed to be

3. Letting it calculate volume every time particle sim restarts Makes particles not follow ground well, up in air 5 inches where they are supposed to be

None of this volume based collision works, been trying all these steps several days in a row.

Then I tried bullet solver only by turning off "use volume based collisions".

This causes the particles to fall through the ground, not holding onto collisions properly.

So I have decided to make my own "solver" using vex and they seem to collide much better somehow with the ground. Using volume sample math and volume gradient math.

I have figured out bounce for the most part. It's just reflect(@v, volumegradient);

The problem is friction I don't know where to begin to apply friction. I took physics in college and was great but am failing to know how to go about getting this force.

Can someone help this newb?

Obviously we already have Weight is just mass * gravity.

The N force appears at first glance it could just be volumegradient * -1 but it isn't. But I really just don't know where to go from here.

Share on other sites

If plain trick is enough for friction. It could be velocity, modulated by (absolute of) dot product of (normalized) velocity and colliding surface normal. If colliding surface is moving, add a copy of velocity from colliding surface into mix. All that, only after collision criteria is met. Another plain trick is, to never use full weighted mix. Always keep the small ratio (1/100, 1/10 or something) of original velocity alive, to get a smoother transitions.

Edited by amm
Share on other sites

Thank you very much. I'm going to try this out in a few. Just so I understand, in your first tip, when you say modulated you mean this guy right? %. Can you help me understand what that does in this scenario?

Also, so I wouldn't need to worry about finding the angle between the weight of the particle and the inverse of the surface normal (possibly, I don't know) to get Ff = mg*cos(theta)? That's why I was confused.

Share on other sites

Just so I understand, in your first tip, when you say modulated you mean this guy right? %. Can you help me understand what that does in this scenario?

Also, so I wouldn't need to worry about finding the angle between the weight of the particle and the inverse of the surface normal (possibly, I don't know) to get Ff = mg*cos(theta)? That's why I was confused.

Actually I meant, multiply. Anyway, some relation of collision surface normal, and particle velocity, gives the diffrerence, related to 'hit angle'. This is of course just a plain trick, in 'eye pleasant' category, I'm afraid it has nothing with physics.

By the way, when it comes to VEX solver, is there a way to get a sub - frame sampling, somehow. Last time I've tried, using Geometry VOP, didn't find a way.

Share on other sites

fwiw, if you're going to use a solver-sop and vex, you can get sub-frame right from the solver but you have to write your vex code to be aware of the time slice (ie, use TimeInc in places where you're changing your particles' values).  so P=P+v*TimeInc; v=v+gravity*TimeInc; etc. otherwise your subframe calcs don't run "slower" to add up to the same overall effect.

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.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

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

×
×