Jump to content

random transform with for each loop


Recommended Posts

  • 1 year later...

rand(0.5234 + detail("../foreach_begin1_metadata1","iteration",0))

How do you set the values it produce inbetween two values. Let's say between -40 & 40

With this "For-Each connected Piece" all the objects get the same rotation/translate values, I tried to fix it but still no luck.

I spent hours trying to figure it out!

Thx

Edited by klawchi
Link to comment
Share on other sites

The rand() function produces a value between 0-1. Knowing this, to set a range, simply use:
[range_start] + rand([seed]) * [range]

In your example, this would be:
-40 + rand(seed) * 80

Make sure your For Loop is running over the correct geometry type (Points/Prims/Count).

Link to comment
Share on other sites

11 minutes ago, Fenolis said:

The rand() function produces a value between 0-1. Knowing this, to set a range, simply use:
[range_start] + rand([seed]) * [range]

In your example, this would be:
-40 + rand(seed) * 80

Make sure your For Loop is running over the correct geometry type (Points/Prims/Count).

Thank you so much.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...