Jump to content

Apply POP force to some points


Recommended Posts

Hello!

 

After transferring a color attribute to some points I would like to apply them a force, as long as they have the blue color transferred.

I've tried the following code in the pop force node without success:

 

 

vector color= point(0,"Cd",@id);

 

if(color.z !=0 )
force*=@id;
 
 
What am I doing wrong?
 
 
Thanks
Link to comment
Share on other sites

Force is a float attribute, right?

 

Try:

f@force *= i@id;

Use the shortcut letters in front of the @ symbol to insure the correct type casting.

 

That particular code example does not make sense, however. You would be multiplying the force by the index of the point. So the first point won't move at all, the second will will move slow and the third one twice as fast as the second one etc...

 

Perhaps something like this for random force applied to each point within a given range.

f@force *= fit01(random(i@id), 0.4, 1.2);
Edited by Atom
Link to comment
Share on other sites

Hello,

 

I've tried the some more expressions but the points with transferred attributes still move with the other points, so multiplying the force by the index is not a good option indeed.

 

Could it be a good choice to use a point cloud expression ?

 

I have attached a test file so you can see what i'm trying to do

 

Thanks 

point_color_force_v1.hip

Edited by pau22
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...