majinpu Posted June 6, 2017 Share Posted June 6, 2017 Hi there ! I just started to do some little things in vex! I can't understand how to create a random integer attribute. If i put down an attribute wrangle on some points and I type in: f@number = rand(@numpt); I can get some random float values. But if i write in : i@number = rand(@numpt); I can just get 0 on all my points. I think is very simple but I cannot sort it out! may be with a fit function? thanks! Quote Link to comment Share on other sites More sharing options...
MagicRej Posted June 6, 2017 Share Posted June 6, 2017 (edited) By default rand function creates a random number between 0 and 1 from a seed. Multiply this value i@rand_num = int(rand(@ptnum)*10); or use fit function i@rand_num = int(fit(rand(@ptnum), 0, 1, 0, 10)); And also in your example you used a @numpt as seed (which is return total number of points). Hope it's help. Edited June 6, 2017 by MagicRej 1 Quote Link to comment Share on other sites More sharing options...
majinpu Posted June 6, 2017 Author Share Posted June 6, 2017 THANKS A LOT MagicRej!! 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.