Sorry to ask, i've searched online for hours.
If for example ...
perlin = minetest.env:get_perlin(SEEDDIFF, 3, 0.5, 150)
What range of values does ...
perlin:get2d({x = pos.x, y = pos.z})
... give? -1 to 1 or 0 to 1?
paramat wrote:hmmm ... actually i see it occasionally exceeds the -1 to 1 range.
local function clamp(value, min, max)
if value<min then return min end
if value>max then return max end
return value;
end
srifqi wrote:Looks like Minetest's PerlinNoise is buggy. You can use clamp function: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 function clamp(value, min, max)
if value<min then return min end
if value>max then return max end
return value;
end
Users browsing this forum: No registered users and 18 guests