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

How can this be extended to be used in 3D Graphics? #1

Open
knightcube opened this issue Apr 20, 2021 · 1 comment
Open

How can this be extended to be used in 3D Graphics? #1

knightcube opened this issue Apr 20, 2021 · 1 comment

Comments

@knightcube
Copy link

I am using three.js to create dynamic geometries using this tutorial.

I tried replacing the following two lines of code

var value = noise.perlin2(x, y);
var value = noise.perlin3(x, y, z);

with this,

var value = perlin.get(x,y)

But it would be great if I could add a z property too

@obscuredc
Copy link

obscuredc commented Jan 26, 2024

I know it's been 2+ years, but for anybody else:
I bet you could edit the current code by following wikipedia's guide to creating the algorithm and using the preexisting dot_prod and smootherstep functions to extend the function to include a z component
edit: specifically, here:

...using a three-dimensional approach by interpolating between 8 corners of a cube instead of the 4 corners of a square below.

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