bootshank Posted March 6, 2019 Share Posted March 6, 2019 Hello, first post here. I'm trying to do something that seems simple but I just cannot figure it out. I'd like to take a piece of geometry and copy it to points, and randomize scale in each direction to give it some variation. I've tried using rand() a number of different ways, in a for-each loop, but any time I apply a random change to scale in X, Y and Z each copy ends up looking identical. It's probably dead easy but I'm stuck! Thanks in advance for any help. Quote Link to comment Share on other sites More sharing options...
bootshank Posted March 6, 2019 Author Share Posted March 6, 2019 Well I couldn't make it work in a for-loop, but I scrapped it and just used a point wrangle on the points coming in to the copytopoints with this: v@scale = 1; v@scale.x = rand(@elemnum); v@scale.y = rand(@id); v@scale.z = rand(@ptnum); I guess the key is varying the random element between each component, rather than using the same one... Quote Link to comment Share on other sites More sharing options...
markinglevfx Posted March 7, 2019 Share Posted March 7, 2019 Yep, you got it Although instead of using three separate attributes, you can use '@id+123', '@id+456', '@id+789' for the x, y and z random seeds (or any other values you see fit). The rand() function just uses the seed you give it to generate a value from 0 to 1. Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted March 7, 2019 Share Posted March 7, 2019 9 hours ago, bootshank said: Well I couldn't make it work in a for-loop, but I scrapped it and just used a point wrangle on the points coming in to the copytopoints with this: v@scale = 1; v@scale.x = rand(@elemnum); v@scale.y = rand(@id); v@scale.z = rand(@ptnum); I guess the key is varying the random element between each component, rather than using the same one... For simple cases you can use an Attribute Randomize SOP. Quote Link to comment Share on other sites More sharing options...
bootshank Posted March 7, 2019 Author Share Posted March 7, 2019 Thanks for the tips! 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.