perdugames / SoftNoise-GDScript-

GDScript function set generating noise (value noise, perlin noise, opensimplex(2d, 3d and 4d)...).
MIT License
108 stars 23 forks source link

looks nice, not sure how to use it #2

Closed drarem closed 6 years ago

drarem commented 6 years ago

I did this

softnoise.openSimplex2D(150, 150)

but nothing is being drawn. What do i do with the return value? Or where do i put the draw code at?

drarem commented 6 years ago

Tried this too, but not getting any variation in var a or e:

softnoise = preScript.SoftNoise.new()
softnoise = preScript.SoftNoise.new(1729)
var nx
var ny
for y in range(20):
    for x in range(20):
        nx = x/20 - 0.5
        ny = y/20 - 0.5
        var e =  1 * softnoise.perlin_noise2d(1 * nx, 1 * ny) +  0.5 * softnoise.perlin_noise2d(2 * nx, 2 * ny) + 0.25 * softnoise.perlin_noise2d(4 * nx, 4 * ny)
        var a = pow(e, 2)
        print("\nvalue=",e, ":: a=", a)
perdugames commented 6 years ago

I recommend that you study noises, and what you want to do with them, if it is a generation of land, study the generation of land. The noise will only give you a pseudorandom number between 0.0 and 1.0.