Implementation of 3D perlin noise

I’va got a basic 3D perline noise algorithm and i’m trying to use it to generate terrain. After looking across the internet, most people seemed to tell me to use it as a volume system so if the noise value at that point is bigger than 0 place a block there.
My current code looks likes this


ClassicNoise.noise(x, y, z) > 0 // if this statement is true set the block at that point to visible

I still only get a bunch of random blocks though :S, waht have i done wrong ???

You have to describe what it is that you want do before anyone can give you much feedback. Like do you want something like this: http://www.iquilezles.org/www/articles/morenoise/morenoise.htm ?

General notes:

  1. 2D is what you want to make a “normal” terrain (i.e. basically changing a flat plane into something…well not flat). 3D if you’re wanting to create a terrain on the surface of a sphere (like a planetary body). 3D again if you’re making holes out of something solid…etc. etc. So the number of dimensions is related to the base data that you’re working with. (this is ignoring animation, which typically requires adding an extra dimension)

  2. Noise function typically return results on [-1,1] so you’re going to want to scale the output.

  3. A single sample of noise probably isn’t going to give anything reasonable looking.

  4. The (>0) bit is an arbitrary choice…most chosen as a ‘sea level’ value. If you’re not adjusting the output ranges, this will (on average) mean that 50% of you’re space is unaffected by your noise generation. Higher numbers will mean less and lower more.

Just a quick note for anyone looking at this post. I realized my mistake

Instead of parsing x,y,z into the noise function, the x,y and z coords were to big and were giving too much variation
I solved this by dividing the coords by the dimensions of the map

e.g

the map is 50x50x50 blocks and the blocks im parsing’s coords are 35,46,12

what i should parse into the noise function is 35/50,46/50,12/50

You can divide it by different numbers to achieve different levels of variation