Log in to vote

How could the math.noise function be used for efficient 3d terrain?

Asked by 2 years ago
Edited 2 years ago

So, in the past week, I have been experimenting around with math.noise in generating terrain, first by just using it to generate smooth looking hills, which went well, then to making voxel terrain, which did not go as well.

The first code I tried out was the following:

local seed = tick()
for x = 0,150 do
    for y = 0,150 do
        for z = 0,150 do
            local p ="Part")
            p.Size =,5,5)
            p.CFrame = *,z/33,seed),math.noise(x/35,z/33,seed),math.noise(x/31,y/29,seed)))
            p.Anchored = true
            p.CanCollide = true
            p.Parent = workspace

There is an obvious problem with this script, and it is that it doubles over onto itself multiple times

I think the limited range of perlin noise might be at fault here (besides my own lack of expertise in this topic.)

So, I'm wondering if there is anything else I'm doing wrong, and is there other way to use 3d perlin noise for voxel terrain generation?

When I say voxel terrain, I don't mean the roblox or astroneer smooth terrain, I mean like Minecraft-esque blocky terrain

My apologies if anything in this question isn't phrased correctly, I'll try to correct it if it is found or pointed out

That thread and websites linked in that thread doesn't really explain how to position objects in order to utilize perlin noise for 3d terrain, also none of image links work theking48989987 2141 — 2y

Answer this question