Random speed for copied geos

   2244   5   0
User Avatar
Member
101 posts
Joined: 9月 2015
Offline
Hi guys,

I'm trying to figure out a way to animate copied geos so that each moves at a different rate in a chosen translate, eg X.

Right now I have a transform node after the copy that has (-$F *.04) in the X translate. I'd like there to be a random variance applied to each copy coming into this transform. I have 10 “clones” and want each one to move at a slightly different speed in the X.

Any tips would be appreciated. Thank you!

T
User Avatar
Member
8 posts
Joined: 1月 2016
Offline
A simple way to do this is with vops.

If you are copying onto points then you could put a point VOP on the points before the copy. The vop takes point ID and generates a random number from 0 to 1 and then fits this to a user specified range, such as 0.35 to 4.5, and then multiplies it by the current frame.

Take the position and set the vector component 1 to the output of the frame multiply. Add this to the unaltered position value and pipe it into the output P.

It wouldn't be too hard to do this in VEX either if you are feeling a bit codey.

Hope that helps!
Have fun
Edited by Alex P Twigg - 2017年3月1日 11:46:45

Attachments:
point_vop.hip (111.5 KB)

User Avatar
Member
101 posts
Joined: 9月 2015
Offline
Alex Twigg2
A simple way to do this is with vops.

If you are copying onto points then you could put a point VOP on the points before the copy. The vop takes point ID and generates a random number from 0 to 1 and then fits this to a user specified range, such as 0.35 to 4.5, and then multiplies it by the current frame.

Take the position and set the vector component 1 to the output of the frame multiply. Add this to the unaltered position value and pipe it into the output P.

It wouldn't be too hard to do this in VEX either if you are feeling a bit codey.

Hope that helps!
Have fun

That works very nicely. Thank you Alex!
User Avatar
Member
101 posts
Joined: 9月 2015
Offline
Here's the VEX code if anyone wants it. Figured it out after Alex suggested I should try.

@a= fit01(rand(@ptnum), ch('slowest'), ch('fastest'));
f@b = ch(“speed_rate”);
@c = (@a * @b);
@P.y = (@c * @Frame);

Pop this into a point wrangle after a scattered primitive then feed it into a copy sop on the right side. This can be really handy for controlling the random speed of things like bubbles rising or objects in formation in a controlled art directed way.

Don't forget to adjust the axis in the @P.* to target direction of motion. Also, hit the parameter creation button on the right of the code so you get the sliders to dial in your values.

Thank you Alex for putting me in the right direction.
User Avatar
Member
2045 posts
Joined: 9月 2015
Offline
I like working in Vex…but for something like this I would prefer creating a CHOP network and just use different export nodes for each variance of your expression or waveforms to each X transform parameter. Much more simpler, and quicker to make changes and adjustments.
User Avatar
Member
101 posts
Joined: 9月 2015
Offline
BabaJ
I like working in Vex…but for something like this I would prefer creating a CHOP network and just use different export nodes for each variance of your expression or waveforms to each X transform parameter. Much more simpler, and quicker to make changes and adjustments.


Apples…oranges…

4 lines of code in a single node with user input and a single variable to change in the code for axis desired. Just as easy to add waveform functions in one line of code with user control as well. I'm not a VEX guru by any means but it sure seems a whole lot simpler and efficient this way. These 4 lines of code were based on a node tree that took 2 parent nodes and another 7 nested to do the same thing.

Another sincere thanks to Alex for taking the time to show it and his nudge to experiment. It led to a great result I think.

It comes down to user comfort I guess. Nodes versus code. I'm adverse to code as the next guy but I'm trying to get better at VEX for reasons that this example clearly demonstrates.

The beauty of Houdini is that there's many ways to do whatever you want. Float your boat however you like.
  • Quick Links