Hwlp with setting up perlin noise gen?
Posted: Fri Jan 03, 2025 8:09 am
Ive been going at this all day to try and get one of those pretty noise maps, but pretty much all i get using the love.math.noise function is random values. do i need do something completly different to make on of those?
for reference here is the code i was trying to get to work--
function love.load()
y_resolution = 800
x_resolution = 1400
mesh_data = {}
x = 1
y = 1
love.window.setMode(x_resolution, y_resolution, {resizable=true})
for i = 1, y_resolution, 10 do
for p = 1, x_resolution, 10 do
table.insert(mesh_data, {p, i, love.math.noise(x, y)})
x = x+1
end
y = y + 1
end
end
function love.update(dt)
if love.keyboard.isDown("escape") then
love.event.quit()
end
end
function love.draw()
for i=1, #mesh_data, 1 do
love.graphics.setColor(mesh_data[3],mesh_data[3],mesh_data[3])
love.graphics.circle("fill", mesh_data[1], mesh_data[2], 5)
end
end
like i said, for some reason it just looks like circles with random shades instead of the uniformity i was looking for. help please?
for reference here is the code i was trying to get to work--
function love.load()
y_resolution = 800
x_resolution = 1400
mesh_data = {}
x = 1
y = 1
love.window.setMode(x_resolution, y_resolution, {resizable=true})
for i = 1, y_resolution, 10 do
for p = 1, x_resolution, 10 do
table.insert(mesh_data, {p, i, love.math.noise(x, y)})
x = x+1
end
y = y + 1
end
end
function love.update(dt)
if love.keyboard.isDown("escape") then
love.event.quit()
end
end
function love.draw()
for i=1, #mesh_data, 1 do
love.graphics.setColor(mesh_data[3],mesh_data[3],mesh_data[3])
love.graphics.circle("fill", mesh_data[1], mesh_data[2], 5)
end
end
like i said, for some reason it just looks like circles with random shades instead of the uniformity i was looking for. help please?