Jump to content

add some noise to cables/ropes?


anicg

Recommended Posts

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

Link to comment
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
Link to comment
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
Link to comment
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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...