Thanks to visit codestin.com
Credit goes to github.com

Skip to content

perlin.get() always returns 0 #4

@PierBover

Description

@PierBover

I'm trying to replicate your demo but for some reason perlin.get() is always returning 0 or -0.

Is there anything obviously wrong with this?

perlin.seed();

for (var y = 0; y < 200; y += 1){
  for (var x = 0; x < 200; x += 1){
    const random = parseInt((perlin.get(x, y) / 2 + 0.5) * 255);
    context.fillStyle = `rgb(${random},${random},${random})`;
    context.fillRect(x, y, 1, 1);
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions