Jump to content
chiess

Collision depth (how far are points inside another geometry)

Recommended Posts

Hi,

 

I am not sure how I should search for that topic, but I have following issue:

 

Two objects are colliding with each other. How do I figure out how deep one object (the individual points) went into the other object. 

At the moment, I am using a attribTransfer to figure out which points are colliding (run them through a sop solver and simply color them red for now). But I didn't find a good solution to figure out the depth of the points inside the other object.

The solution I am currently using (but I am absolutely not satisfied with it), is a ray sop with distance attribute and reverse normals. It is a very ugly solution and depends heavily on the collision object geometry and their normal directions.

 

I am pretty sure that issue is very common and there are better solutions out there :).

If anyone knows a better solution and/or has a link to another discussion that already talked about it, that would be great!

 

Thanks,

chiess

Share this post


Link to post
Share on other sites

Hi magento,

 

Thanks! Yes, I was thinking about it, but was really looking for a solution without using volumes. The geometries I get are very complex and would need a couple steps to get nice looking volumes out (creating a waterproof hull with vdb's etc.). For a procedural solution (many different forms of geometry) this might be too much in the end, as of, too many steps which are extremely dependent on the input geometry. However, I think there is no "easy" way around it anyway.

 

Thanks!

Share this post


Link to post
Share on other sites

Without volumes, I think you can use the Ray SOP or the Minimum Position VOP and store the distance and normal attributes for the intersection (Ray SOP provides these) and @dist should show you how much the point is inside or outside (unsigned). So you would need to use the normals etc to determine if they are inside or outside and if they are inside @dist will be the value you need.

Share this post


Link to post
Share on other sites

Hi,

 

@magneto: yep, that is exactly what I am doing right now, using the ray sop. The result is ok, but could be better. Maybe I am doing something wrong though.

 

@Pradeep Barua: Thanks for the example files, will have a look asap!

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

×