Code Monkey home page Code Monkey logo

Comments (6)

pbaille avatar pbaille commented on September 23, 2024

is it normal that it output exactly 0 more than 10% of the time?

(count (filter zero? (take 100000 (map noise1 (iterate (partial + (rand)) (rand 100000)))))) 
;;=> 10548

from math.

postspectacular avatar postspectacular commented on September 23, 2024

Investigating, thanks for letting me know....

from math.

postspectacular avatar postspectacular commented on September 23, 2024

Just for reference this code was ported from this OpenCL version here: https://github.com/terrybroad/Simplex_Noise_OpenCL/blob/master/Simplex_Noise.cl

from math.

postspectacular avatar postspectacular commented on September 23, 2024

Just updated (and optimized) these functions, but still not 100% sure where the scaling issue is coming from (actually might be already present in the original version this code is based on). Also have added some images and renamed the namespace to thi.ng.math.noise (since I will add more noise gens, the current one is actually gradient noise, not the simplex noise, which is still waiting to be ported).

I removed the final normalization step from all fns, but noise1 now has a range of -1 .. +1. noise2 and noise3 seem to go from -1 .. +0.89....

https://github.com/thi-ng/math/blob/master/src/noise.org

from math.

pbaille avatar pbaille commented on September 23, 2024

great! I will take a look as soon as possible

from math.

postspectacular avatar postspectacular commented on September 23, 2024

let's maybe not close this just yet...
also, if you want to play around w/ it, use the [thi.ng/math "0.2.0-SNAPSHOT"]

from math.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.