Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenSimplex not continuous? #220

Open
MacTuitui opened this issue Nov 14, 2019 · 1 comment
Open

OpenSimplex not continuous? #220

MacTuitui opened this issue Nov 14, 2019 · 1 comment

Comments

@MacTuitui
Copy link

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?

@mystise
Copy link
Contributor

mystise commented Dec 5, 2019

This is perhaps due to: #141 manifesting weirdly in 4D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants