Using correct seed for randomizing iterations

   2735   2   1
User Avatar
Member
11 posts
Joined: Aug. 2017
Offline
I am trying to make a for each loop that will vary the heights of the buildings in procedural city. I am copying floors on top of each other in a for each loop, and am trying to randomize the number of iterations that the for each loop will go through so that the number of floors will vary. I can't seem to accomplish this, and I suspect it's because I'm not using a good seed for the rand() I am calling in my for loop. I have attached my file below and would very much appreciate some insight. Thank you!

Attachments:
City_attempt1_03.hipnc (100.7 KB)
help.PNG (1.2 MB)

User Avatar
Member
28 posts
Joined: Nov. 2013
Offline
If you make a new metadata node for the first loop and you change the expression in the “foreach_end2” node to
“fit01(rand(detail(”../name for new meta data node/“,”iteration“,0)),10,20)”
it will work.
I made a different approach to check out. This method is a lot faster when using a lot of points to copy to.

Attachments:
City_differentApproach.hipnc (99.0 KB)

User Avatar
Member
393 posts
Joined: Nov. 2016
Offline
I would add a random number to the seed as well, in case you want to randomize more than one value.
  • Quick Links