catchyid Posted November 9, 2018 Share Posted November 9, 2018 Hi, I am trying to create random points using VEX. Basically, It's a Geo node with only one Detail Attribute Wrangle node: for(int i = 0; i < 100; ++i) { vector pos=set(rand(0.1*@Frame),rand(@Frame),rand(10*@Frame)); addpoint(geoself(),pos); } I get 100 points, but all have the same location? Any idea why all rand() is producing the same position for all points? Thanks, Quote Link to comment Share on other sites More sharing options...
evanrudefx Posted November 9, 2018 Share Posted November 9, 2018 rand always produces the same results unless you have a different seed. All 100 points are getting the same seed on each axis, so every point is in the same position. I suppose you would need to vary the seed of each axis across the points. 1 Quote Link to comment Share on other sites More sharing options...
catchyid Posted November 9, 2018 Author Share Posted November 9, 2018 Oh my god how embarrassing ! not sure what made me thought the seed was different! I did not ask this question 1 Quote Link to comment Share on other sites More sharing options...
Noobini Posted November 9, 2018 Share Posted November 9, 2018 (edited) you're getting different results for each frame, good, but for each frame, the 100 points are the same. So you need another tie breaker, the 'i', just mult each Frame with i for(int i = 0; i < 100; ++i) { vector pos=set(rand(0.1*@Frame*i),rand(@Frame*i),rand(10*@Frame*i)); addpoint(geoself(),pos); } Edited November 9, 2018 by Noobini 1 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.