Jump to content

Ramps on vector attributes


valorSix

Recommended Posts

Hello I have a question about the ramp function .

I understand that the chramp function looks for a 0-1 value but what does it mean when i provide it with a vector attribute like @P ? 

If I have a grid and use this expression:

f@active = chramp("active", v@P, 0);
v@Cd=@active;

This will return a gradient striped pattern on my grid. But why ? I have not provided any 0-1 value here only the values of each point position. Is the chramp function trying to convert this into float 0-1 values ? 

Thank you

ramp_vector_attrib.hipnc

Link to comment
Share on other sites

Hi,

the ramp function is performing an implicit float cast on vector input, that means, it will take the first component only. You schould get the same results, if you are using v@P.x instead of v@P (but with v@P.z you will get another result).

The other thing is, that the ramp function is expecting values between 0 and 1, so it uses modulo one by default. For example 3.75 will be mapped to 0.75 and -0.1 will be 0.9.

 

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...