random UV transform

   3500   4   1
User Avatar
Member
196 posts
Joined: 8月 2011
Offline
Hi ..

I have a group of geometry pieces that I unwrap. then, in a for each loop, I want to offset each piece's UVs by a random value with rand(1) in u and v.

But that does not work correctly. There is some random transformation going on, but not for each piece individually (that's why I assign it in the for each sop), but ALL pieces get the same random value assigned ('globally').

What could be the issue ?

Any input ?

Thanks..

m.
User Avatar
Member
3 posts
Joined: 1月 2014
Offline
Actually, rand(1) will always return you the same value because of its deterministic nature. To get different random values you must use different seeds. In your case, something like rand(a*u) and rand(b*v) may be reasonable, where a and b are any real numbers of your choice, except zero. You can try a=b=1 as a starting point.
User Avatar
Member
196 posts
Joined: 8月 2011
Offline
I see .. thanks ..

but can those numbers (a,b) be created in the expression I use for the UV transformation ?

I thought about changing the seed, but I am not sure where to set it ‘per piece’..
User Avatar
Member
30 posts
Joined: 9月 2010
Offline
In a for each loop you can use an expression like rand(stamp(“../”, “FORVALUE”, 0)*733.73).
This way the rand function will generate a random offset using the iteration number times some other number (for variation) as a seed.
So you can have for U rand(stamp(“../”, “FORVALUE”, 0)*733.73)
and for V rand(stamp(“../”, “FORVALUE”, 0)*328.42)
User Avatar
Member
196 posts
Joined: 8月 2011
Offline
thanks for those great inputs, guys !!

m.
  • Quick Links