Home

Awesome

Noise in Cairo

2D Perlin Noise - How To Use

Add perlin2D.cairo and its dependency Math64x61.cairo to your project folder, and import noise2D_custom into your project as follows

from perlin2D import noise2D_custom

Then define a new function with your desired parameters:

func my_noise{pedersen_ptr : HashBuiltin*, bitwise_ptr : BitwiseBuiltin*, range_check_ptr}(x, y) -> (noise):
    let (noise) = noise2D_custom((x, y), 100, 69)
    return (noise)
end

About noise2D_custom

<br> <hr> <br>

3D Simplex Noise - How to use

Add simplex3D.cairo and its dependency Math64x61.cairo to your project folder, and import noise3D_custom into your project as follows:

from simplex3D import noise3D_custom

Then define a new function with your desired parameters:

func my_noise{range_check_ptr}(x, y, z) -> (noise):
    let (noise) = noise3D_custom(x,y,z, 100, 69)
    return (noise)
end
<br>

About noise3D_custom