Jump to content
Sign in to follow this  
anicg

add some noise to cables/ropes?

Recommended Posts

I have cables(see image and network) and I'd like to add a bit realism/noise instead of each following a straight line, the cable is meant to be very long.

ropes.JPG

Share this post


Link to post
Share on other sites

Here is one way, You can control the ramp so you can affect where you want to add the noise,  etc

noiseWires.hipnc

Screen Shot 2019-01-24 at 11.05.55 AM.png

Screen Shot 2019-01-24 at 11.06.03 AM.png

Edited by Sepu
  • Like 1

Share this post


Link to post
Share on other sites

many thanks, it works great, it took me a while to figure out what's going on in the attributevop stuff, but it works. Thanks.

Share this post


Link to post
Share on other sites

And VEX noise version:

// Define UI controls
float remap_uv = chramp('remap_uv', @uv.x);
float power = chf('Noise_Power');
float freq = chf('Noise_Frequency');

// Create noise
vector noiseXYZ = noise(@P*freq);
// Modify noise values
vector displace = fit(noiseXYZ, 0,1, -1, 1)*power*remap_uv;
// Apply modified noise to a points position
@P += displace;
// Visualize fade ramp on curve
@Cd = remap_uv;

Personally, I would try to use bounding box information to get curve ends, but Herman solution with UVs much nicer!

noiseWires.hipnc

Share this post


Link to post
Share on other sites

For the VEX stuff, which node should I use and past it in? thanks (I'm new)

Share this post


Link to post
Share on other sites
42 minutes ago, anicg said:

For the VEX stuff, which node should I use and past it in? thanks (I'm new)

After Copytopoints, add Attribute Wrangle and paste the vex code in. Then click on this icon (see below in the picture) to generate the parameters. The Polywire comes last.

a.JPG

Edited by reeson

Share this post


Link to post
Share on other sites

!There is a scene file attached to my previous post with a Sepu setup and my VEX option:

noiseWire_01.thumb.PNG.f24d9acbed68b6300e13022076cd4620.PNG
 

It requires uvtexture SOP in "Pts and Columns" mode before this wrangle, so you have to create wrangle after uvtexture SOP!

Just use output from Attribute Wrangle "noise" node in your further network

Edited by kiryha

Share this post


Link to post
Share on other sites

I use noise function a lot to randomize something or to bend geometry. The basic code is :
 

// Define UI controls
float noise = chf('Noise_Power');
float freq = chf('Noise_Frequency');
// Create noise
vector noiseXYZ = noise(@P*freq);
// Remap and pply noise to a point position
v@ns = fit(noiseXYZ, 0,1, -1, 1)*noise;
@P  += @ns;

It will add value in the range between -1 and 1 to a point position. Each point will get individual value defined by noise parameters.

One more example, if I need to randomize the distribution of scattered points I use nose to delete them. Here is VEX delete points under noise pattern file. Instead of removepoint() you can use another function, to add/set attributes etc.

noise_01.thumb.gif.c35f1352abe41297c0e09240e830dd8b.gif

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×