Jump to content
anbt

Prevent collision within SOP based 'dynamics'

Recommended Posts

Posted (edited)

Hi there,

I am growing and instancing a few plants on a surface. The growth animation is done at the SOP level. 

I am now trying to have them collide with one another. But because everything is done in SOP, I actually don't know how to tackle this issue.

Any idea? Thank you

Edited by anbt

Share this post


Link to post
Share on other sites

Use volumes.

 

a) turn the object you want to collide it with into a VDB. 
b ) pipe the geo object (your plant...whatever) into a point wrangle.
c) pipe the VDB into the point wrangle's 2nd input.

 

float f = volumesample(1, "surface", @P) //samples a volume called "surface" which is fed into the second input as counting starts at 0
if(f<0)
{
	@Cd=set(1,0,0);
}
else
{
    @Cd=set(0,1,0);
}
        
        
        
        

This will colour the collided points red. 

Depending on your implementation of the growth animation, you can now use this collision information to make your 'plant' do something when it is colliding with that collision object.

The reason why you don't get an earlier answer is probably that nobody knows how you implemented that 'animated growth'. Your description is rather murky and there are many ways to do this. 

  • Like 1

Share this post


Link to post
Share on other sites

thanks! ok, I understand that I was quite unclear.
I animated the growth of different plants using different techniques. One is a rigged curve fed into a Revolve Sop. The animation is made of keyframes.
I am also using a carve node for the stem, and I animate (with keyframes) the u and v. Basically only SOPS and keyframes.
I am using some noise on the points to make them move.
Then other ones are more or less done in the same way using only SOP nodes and instancing some geometries along the normals of the points of the stem.

I am looking for different methods to make SOP based geo collide with each other. It might sound extremely vague, sorry for that, I don't know how to be more specific.

So, the method would be to use volumes and some vex?

If anyone knows some other ways, even if it doesn't apply to my issue, I'd still love to know. I am looking for directions to experiment with. 

Thank you very much
 

 

Share this post


Link to post
Share on other sites
Posted (edited)

maybe I could turn those plants into a really stiff vellum and the collisions would be handled there, but with all the remeshing needed to get the geometry to work with vellum, I am not sure I would end up with a satisfying result. And it might be super slow if I instance thousands of plants!!!

Edited by anbt

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

×