This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Ll]ibrary/ | |
| [Tt]emp/ | |
| [Oo]bj/ | |
| [Bb]uild/ | |
| [Bb]uilds/ | |
| Assets/AssetStoreTools* | |
| # Visual Studio 2015 cache directory | |
| /.vs/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| # script globals | |
| normal_distribution_amount = 12 | |
| min_height = 1 | |
| max_height = 10 | |
| def get_random_height(): | |
| random_height = hou.hmath.fit(random.random(), 0, 1, min_height, max_height) | |
| return random_height |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (fit(rand($PT*0.77), 0, 1, 1, 10) + fit(rand($PT*0.97), 0, 1, 1, 10) + fit(rand($PT*0.778), 0, 1, 1, 10) + fit(rand($PT*0.17), 0, 1, 1, 10) + fit(rand($PT*0.37), 0, 1, 1, 10)) / 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // using houdini's built in noise functions | |
| // in the VEX expression language | |
| // http://www.sidefx.com/docs/houdini/vex/index.html | |
| // this is a Point Wrangle, meaning this code will be called | |
| // for every point in the geometry | |
| // each time it is called @P is equal | |
| // to a different point in the geo | |
| // params are located on the attribute wrangle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int seed = set(ch("seed")); | |
| float strength = ch("strength"); | |
| // trying out smoothing between two random values | |
| float smoothedRand = smooth(random(seed + @pointnum),random(seed + @pointnum+1), 0.5); | |
| // moving random from 0 to 1 to -0.5 to 0.5 | |
| float equalized = 0.5 -smoothedRand; | |
| // y pos displaced based to rand * strength param |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // paramaters come in as floats by default | |
| // in order to cast them to other types | |
| // need to wrap them in a "set()" | |
| int width = set(ch("width")); | |
| int height = set(ch("height")); | |
| int num_points = set(ch("num_points")); | |
| int seed = set(ch("seed")); | |
| // seed needs to be persisted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| u@startpos = chu("startpos"); | |
| u@endpos = chu("endpos"); | |
| f@increment = ch("increment"); | |
| for (float n = 0; n < 1; n += @increment) | |
| { | |
| float x = lerp(@startpos.x, @endpos.x, n); | |
| float y = lerp(@startpos.y, @endpos.y, n); | |
| vector position = set(x , 0, y); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| float amplitude = ch("amp"); | |
| float amp_scale = ch("amp_scale"); | |
| float noise_freq = ch("noise_freq"); | |
| float noise_offset = ch("noise_offset"); | |
| float time_speed = ch("time_speed"); | |
| for(float n = 0; n < 1; n += @increment) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| float noise_freq = ch("noise_freq"); | |
| float threshold = ch("threshold"); | |
| vector seed = @P * noise_freq; | |
| // let downstream nodes access this value | |
| f@noiseval = noise(seed); | |
| if (@noiseval < threshold) { | |
| removepoint(0, i@ptnum); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| float noise_freq = ch("noise_freq"); | |
| float strength = ch("strength"); | |
| vector2 noise_offset = chu("noise_offset"); | |
| float time_speed = ch("time_speed"); | |
| float x_noise = (@P.x * noise_freq) + (@Time * time_speed) + noise_offset.x; | |
| float z_noise = (@P.z * noise_freq) + (@Time * time_speed) + noise_offset.y; | |
| vector noise_seed = set(x_noise, 0, z_noise); | |
| // let downstream nodes access this value |