Razaekel / noise-rs

Procedural noise generation library for Rust.
Apache License 2.0
854 stars 120 forks source link

Perlin noise always returns 0 on whole numbers #337

Closed doonv closed 11 months ago

doonv commented 11 months ago

I don't know what I am doing wrong but perlin noise always returns zero on whole numbers:

let noise = noise::Perlin::new(123578);

println!("{}", noise.get([2.0, 1.0]));
println!("{}", noise.get([2.0, 124.0]));
println!("{}", noise.get([2.0, 12.0]));

// With decimals:
println!("{}", noise.get([2.3, 12.1]));

Which results in:

0
0
0
0.33866112622786926

Is this intended behavior? I don't think so.

PrinceOfBorgo commented 11 months ago

Yes, it is the intended behaviour. More info here.

doonv commented 11 months ago

Yes, it is the intended behaviour. More info here.

Ah thanks, you should add that to the documentation.