Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
My Perlin noise script doesn't interpolate right

I'm trying to make a Perlin noise function, but the interpolation doesn't work right. I hoped that switching the different dot products at the interpolation would work, but it doesn't. I also tested if my interpolation function works and it looks likes it does work.

My script is at: https://codepen.io/Koen124/pen/WNZyMdj?editors=0010

    var x10 = x - Math.floor(x); // x10 is between 0 and 1
    var y10 = y - Math.floor(y); // y10 is between 0 and 1
      
    // topleft && topright
    var upInterpolate = (vec_dot[0]*cosInterp(x10))+(vec_dot[1]*(1-cosInterp(x10)));
      
    // bottomleft && bottomright
    var downInterpolate = (vec_dot[2]*cosInterp(x10))+(vec_dot[3]*(1-cosInterp(x10)));

    var final = (upInterpolate*cosInterp(y10))+(downInterpolate*(1-cosInterp(y10)));

I first tried my Perlin noise script with only 4 vectors which you can see here: https://codepen.io/Koen124/pen/GRMGrEM?editors=0010

The interpolation test is at: https://codepen.io/Koen124/pen/ExwRMgB?editors=0010

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I've already solved it. I had to flip the bottom left and bottom right dot products

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!