Jump to content

Wrangle: Colour from velocity, mapped to Ramp


Recommended Posts

I'm trying to colour a sim after the fact.

 

I've copied some boxes to my fluid sim and added a trail to get the velocity back.

 

So now I'm trying to colour the boxes based on the newly computed velocity but I'm going back and forward with the point wrangle.

I've created a colour ramp in my wrangle interface and tried to access the gradient via a "chramp" but the wrangle doesn't want to play nice.

Does anyone know how to colour based on velocity inside the point wrangle?

 

Link to comment
Share on other sites

what do you mean doesn't play nice? wrangle always plays nice

 

so let's assume you have color ramp parameter named "color_ramp"

and to make it more flexible add 2 float parameters, "min_speed" and "max_speed"

then your code will be something like:

float speed = fit(length(v), ch("min_speed"), ch("max_speed"), 0, 1);
@Cd = chramp("color_ramp", speed);
  • Like 2
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...