valorSix Posted October 2, 2020 Share Posted October 2, 2020 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 Quote Link to comment Share on other sites More sharing options...
Aizatulin Posted October 2, 2020 Share Posted October 2, 2020 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. Quote Link to comment Share on other sites More sharing options...
valorSix Posted October 2, 2020 Author Share Posted October 2, 2020 @AizatulinThank you . I get it now. So basically its doing something like this: v@mod = @P.x%1; v@Cd=v@mod; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.