Symbolic Posted July 30, 2008 Share Posted July 30, 2008 Hi, I have values that go from 0 to 1. So it like: val0 = 0.01 val1 = 0.1 val2 = 0.12 val3 = 0.15 val4 = 0.18 val5 = 0.23 val6 = 0.26 val7 = 0.27 val8 = 0.29 val9 = 0.31 val10 = 0.34 val11 = 0.35 val12 = 0.45 val13 = 0.67 val14 = 1 So I want to snap them to values like: 0,0.2,0.4,0.6,0.8 So it look like: val0 = 0 val1 = 0 val2 = 0 val3 = 0 val4 = 0.2 val5 = 0.2 val6 = 0.2 val7 = 0.2 val8 = 0.4 val9 = 0.4 val10 = 0.4 val11 = 0.4 val12 = 0.8 val13 = 0.8 val14 = 0.8 So what is the way of doing this in VOPs... or basically what is the math behind it? I know it is kind of creating a 5 step ramp from a float ramp... But I just can not put it together Thanks. Quote Link to comment Share on other sites More sharing options...
eetu Posted July 30, 2008 Share Posted July 30, 2008 Perhaps not the cleanest way, but i guess you could multiply by five, floor(), and then divide by five .. eetu. Quote Link to comment Share on other sites More sharing options...
Symbolic Posted July 30, 2008 Author Share Posted July 30, 2008 Hey eetu! That worked... thanks... Quote Link to comment Share on other sites More sharing options...
Symbolic Posted July 31, 2008 Author Share Posted July 31, 2008 But why "...not the cleanest way..."? What is a clean way? Quote Link to comment Share on other sites More sharing options...
rdg Posted July 31, 2008 Share Posted July 31, 2008 But why "...not the cleanest way..."? What is a clean way? I don't think there is a "cleaner" way - as this is fairly versatile. More versatile than a lookuptable. You could create a function for it, maybe. 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.