Jump to content
pszczesny

particle question

Recommended Posts

Hi,

I found this setup for particle morph:

float strength = ch("strength");
float arrivedistance = ch("arrivedistance");

int goalpt = @id % npoints(@OpInput3);

vector goalpos = point(2, "P", goalpt);
f@goaldistance = distance(goalpos, @P);

vector goaldir = normalize(goalpos - @P);

@v = goaldir * strength * fit(@goaldistance, 0, arrivedistance, 0, 1);

 

Setup is very nice but it would be super to add functionality.

Im new to vex. Is it possible to move particle into the nearest point on the target, because at the moment (I attached screenshots) particles morph in random way (evenly fills the entire object )? It would be perfect to fill object starting from the closest point.



I will be very grateful for your help.

 

Regards,

Pawel
 

1.png

2.png

Share this post


Link to post
Share on other sites

give the pcopen function a try! You can retrieve the position of each/the closest point that way and feed it into your goaldir var.

Share this post


Link to post
Share on other sites

Hi, thank you for your answer:) 
I'll try, but I have no experience in houdini. Do you have an example of how to do it?
greetings

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

×