noise-rs icon indicating copy to clipboard operation
noise-rs copied to clipboard

OpenSimplex not continuous?

Open MacTuitui opened this issue 5 years ago • 1 comments

I'm using OpenSimplex to make animations in nannou, and I'm using mostly 4D noise to create loops (where I need 2D noise to loop over itself).

I however ended up with weird artifacts that appear to be non-continuous. For example the following snippet of code.

let mut noise = OpenSimplex::new();
noise = noise.set_seed(1);
let frac = 77.0/600.0;
let angle = frac*TAU;
let acos = angle.cos() as f64;
let asin = angle.sin() as f64;
let steps_j = 4*360;
let frac_i = 0.6;
for j in 0..steps_j {
    let frac_j = (j as f32)/((steps_j-1) as f32);
    let angle2 = frac_j*TAU;
    let v = noise.get([
                        (angle2.cos()*frac_i) as f64,
                        (angle2.sin()*frac_i) as f64,
                        acos*1.0,
                        asin*1.0]) as f32;
    draw.line().start(vec2(frac_j*1024.0-512.0, 0.0))
               .end(  vec2(frac_j*1024.0-512.0, v*800.0)).color(WHITE);
}

produces this image: step

Where you can see the discontinuity. Is this even a bug?

MacTuitui avatar Nov 14 '19 04:11 MacTuitui

This is perhaps due to: https://github.com/Razaekel/noise-rs/issues/141 manifesting weirdly in 4D

mystise avatar Dec 05 '19 04:12 mystise