Hi!
I've got a line on x with a bunch of points. I wanted to make that line curve upward by using a ramp in the Attribute Wrangle.
I'm trying to use the chramp function to modify the position Y but I don't know how to use it. I was trying:
chramp(“curve”, @P.y);
But nothing happens. I'm new to Vex.
-Olivier
curve a line with vex ramp: how?
5454 5 1- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
Ahh! ok ok.
finally wrapped my head around it (I think). I fixed it with:
f@grad = @ptnum/(@numpt*1.0);
@P.y = chramp(“fuckinramp”, @grad);
I didn't get that the second input for the chramp had to be a gradient that I input to begin with.
By the way, what's the difference between f@grad and float grad ? I've seen people define a float with float myvalue before…
finally wrapped my head around it (I think). I fixed it with:
f@grad = @ptnum/(@numpt*1.0);
@P.y = chramp(“fuckinramp”, @grad);
I didn't get that the second input for the chramp had to be a gradient that I input to begin with.
By the way, what's the difference between f@grad and float grad ? I've seen people define a float with float myvalue before…
- BabaJ
- Member
- 2038 posts
- Joined: Sept. 2015
- Offline
- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
Ok, so, in other words, if I don't need this info later (after my attribwrangle), I should use float myvalue, but if I need it later, f@myvalue ?
I had a line with a gradient done with f@ and I changed it for float but the line is now black. I don't get it… can't you tell me what I'm doing wrong?
float grad = @ptnum/(@numpt-1.0);
@Cd = 0;
@Cd.g = @grad;
Thanks.
-Olivier
I had a line with a gradient done with f@ and I changed it for float but the line is now black. I don't get it… can't you tell me what I'm doing wrong?
float grad = @ptnum/(@numpt-1.0);
@Cd = 0;
@Cd.g = @grad;
Thanks.
-Olivier
- BabaJ
- Member
- 2038 posts
- Joined: Sept. 2015
- Offline
you created the float variable ‘grad’ and assigned a value to it - but you don't use it.
You also created an attribute ‘@grad’ but did not assign a value to that, which defaults to 0.
Just adding the ‘@’ symbol to a declared local variable doesn't somehow convert the variable into an attribute.
They are two seperate entities even though they have the same spelling.
You also created an attribute ‘@grad’ but did not assign a value to that, which defaults to 0.
Just adding the ‘@’ symbol to a declared local variable doesn't somehow convert the variable into an attribute.
They are two seperate entities even though they have the same spelling.
Edited by BabaJ - Feb. 21, 2018 13:17:56
- olivierth
- Member
- 1007 posts
- Joined: April 2017
- Offline
Ahhh!! so I need to remove the @
float grad = @ptnum/(@numpt-1.0);
@Cd = 0;
@Cd.g = grad;
Ok! I'll use that whenever I can!
Thanks!
-Olivier
float grad = @ptnum/(@numpt-1.0);
@Cd = 0;
@Cd.g = grad;
Ok! I'll use that whenever I can!
Thanks!
-Olivier
-
- Quick Links