loucifer Posted October 16, 2017 Share Posted October 16, 2017 Silly question, but total wrangle noob here... I want to set random grey scale values on points, not sure if I should be using @id or @ptnum and how the expression would look? TIA Quote Link to comment Share on other sites More sharing options...
Sean-R Posted October 17, 2017 Share Posted October 17, 2017 This should work: @Cd = rand(@ptnum); The rand() with one input will give you a float value between 0 and 1, as Cd is a vector attribute the value will be copied over three times Quote Link to comment Share on other sites More sharing options...
loucifer Posted October 17, 2017 Author Share Posted October 17, 2017 Thanks, how would I control the values, say I don't want it to go pure black or white? Quote Link to comment Share on other sites More sharing options...
Sean-R Posted October 17, 2017 Share Posted October 17, 2017 You can wrap the rand() in a fit function or a fit01 function. The fit01 clamps the input values to 0 and 1: fit01(rand(@ptnum), min value, max value) Quote Link to comment Share on other sites More sharing options...
Yon Posted October 17, 2017 Share Posted October 17, 2017 (edited) ill build off seans line @Cd = rand(@ptnum); // randomize color @Cd = @Cd.x; // make greyscale @Cd = clamp(@Cd,.25,.75); // clamp to min and max where .25 is your min and .75 is your max edit: lol post in the same minute Edited October 17, 2017 by Yon 1 1 Quote Link to comment Share on other sites More sharing options...
loucifer Posted October 17, 2017 Author Share Posted October 17, 2017 Thanks guys, much appreciated! 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.