ela1995 Posted April 20, 2020 Share Posted April 20, 2020 I have a an object that I cut into pieces with grid. For each pieces, i want to move them randomly within x and z direction. But when I write the @P in Wrangle SOP, it only move the point within that piece. I want to move the whole piece not just a point, how do i do that randomTransForeach.hipnc Quote Link to comment Share on other sites More sharing options...
Noobini Posted April 20, 2020 Share Posted April 20, 2020 something like this ? you can put in a Multiplier/seed...whatever...up to you. randomTransForeach_maybe.hipnc Quote Link to comment Share on other sites More sharing options...
Noobini Posted April 20, 2020 Share Posted April 20, 2020 or this ? randomTransForeach_maybe2.hipnc Quote Link to comment Share on other sites More sharing options...
ela1995 Posted April 20, 2020 Author Share Posted April 20, 2020 thank you very much, it helps me alot Quote Link to comment Share on other sites More sharing options...
klawchi Posted March 7, 2022 Share Posted March 7, 2022 (edited) 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 March 7, 2022 by klawchi Quote Link to comment Share on other sites More sharing options...
Fenolis Posted March 7, 2022 Share Posted March 7, 2022 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). Quote Link to comment Share on other sites More sharing options...
klawchi Posted March 7, 2022 Share Posted March 7, 2022 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. 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.