random offset for Sin waves

   9909   4   0
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
I am looking at creating a sin random value to a sign wave inside a bend op, with primary axis set to X

using sin ($FF *3 )*12

This works fine , now is there a way to also have it moving in Y at the same time ? coupled with a rand expression , so when I use the copy stamp all my stems will be randomly moving in X and Y. I know the rand (value ) and I know a sin wave works between +1 and -1 so really I am just looking for a rand value that would off set the ($FF * ) as a starting point. If anyone could give me some pointers I would be greatfull.


Rob
Gone fishing
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
An update ….

what I have done is to get a correct motion is to use a transform SOP and create a Sin expression on the X axis and the Z axis , this works much better than the bend SOP. this way I can have the sin wave work in both X and Y.
Now I would like to use stamp function in the copy SOP ,to randomly apply this sin wave to all my copies created .

I have tried sin($FF*3)*10) it works fine in the Copy sop (stamp) but all the copies move togeather. I have also tried sin($FF*(rand(123)))*10) , again it worked but all the copies get the same motion from the sin wave.

cheers R
Gone fishing
User Avatar
Member
268 posts
Joined: July 2005
Offline
You could do something like this in your $TY field

sin($TX+$FF* “speed offset”+“random X offset”)+ “random Y offset”

replace inbetween the quotes with your copy stamp expressions, something like rand($PT)*10
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
adam Ive tried your solution but I cannot get it to work , do you have a simple file I could look at , grid , sphere , copy stamp ?.
I was thinking along the lines of just have the 1 sin wave then somehow offsetting when and where the the objects start moving along the sin wave maybe using there object ID to drive this.


A slight update using the copy SOP stamp with this expression in the X or Y values

varible1 sin(($F*2) + ($PT*2))
varible2 sin(($F*2)*3 + ($PT*5))

I get a nice movement still a bit to uniform , but at least it works ! would it be possible to add some noise into these expressions using noise(x,y,z) certainly interested in thoughts

R
Gone fishing
User Avatar
Member
65 posts
Joined: July 2005
Offline
circusmonkey
A slight update using the copy SOP stamp with this expression in the X or Y values

varible1 sin(($F*2) + ($PT*2))
varible2 sin(($F*2)*3 + ($PT*5))

I get a nice movement still a bit to uniform , but at least it works ! would it be possible to add some noise into these expressions using noise(x,y,z) certainly interested in thoughts

You could try modifying both the phase and frequency and use rand() instead of noise()

So, for example, something like:

sin( $F*(2+0.5*rand($PT+0.1)) + ($PI*rand($PT+0.2)) )

Cheers!
  • Quick Links