# What is density in this case?

You can write your topic however you want, but you need to answer these questions:

1. What do you want to achieve? To know its meaning

2. What is the issue? No

3. What solutions have you tried so far? Nothing

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

What is density?

``````local xP = math.noise(((y + yOffset) / scale) * freq , ((z + zOffset) / scale) * freq) * ampltiude
local yP = math.noise(((x + xOffset) / scale) * freq , ((z + zOffset) / scale) * freq) * ampltiude
local zP = math.noise(((x + xOffset) / scale) * freq , ((y + yOffset) / scale) * freq) * ampltiude

local density = xP + yP + zP
``````

It’s the combined effect of all three noise functions

ok, what’s the use of density?

This code calculates “perlin noise”. Typically used for making procedural/random generation. Density is meaningless without the full context of the code.

slr. This thing

``````local xP = math.noise(((y + yOffset) / scale) * freq , ((z + zOffset) / scale) * freq) * ampltiude
local yP = math.noise(((x + xOffset) / scale) * freq , ((z + zOffset) / scale) * freq) * ampltiude
local zP = math.noise(((x + xOffset) / scale) * freq , ((y + yOffset) / scale) * freq) * ampltiude

local density = xP + yP + zP

if density >= 10 then
-- create new block part
end
``````

Simply the area of the noise that you are creating. The IF statement checks if the density is big enough to take action. If not, it ignores it.