Hi, i saw this on IRC logs:
* Krock wonders if there's something like <PerlinNoise>:get3d(x, y, z) and which returns a number
There is but it's not well documented, see my very early (pre voxelmanip, pre perlinmap) mods.
In the parameters section set the noise parameters:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local SEEDDIFF = 1975
local OCTAVES = 5
local PERSISTENCE = 0.6
local SCALE = 384
Here 'SCALE' equals the 'spread' of perlinmap noise parameters, the size in nodes of the largest pattern found in the noise. It has one value instead of 3 so applies to all 3 dimensions.
'SEEDDIFF' is the same value as 'seed' in perlinmap noise values.
Then use this once:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local perlin = minetest.get_perlin(SEEDDIFF, OCTAVES, PERSISTENCE, SCALE)
Then you can get multiple noise values of any points in the world by using this multiple times:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local noise = perlin:get2d({x=x,y=z})
Where x and z are the world co-ordinates.
Note 'x=x, y=z' because 2d noise always expects 2 values x and y and you're inputting the world co-ordinates x and z.
For 3D noise:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local noise = perlin:get3d({x=x,y=y,z=z})