This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Xelostar's profile picture

2D noise generation API (with demos)

Started by Xelostar, 07 July 2018 - 12:44 PM
Xelostar #1
Posted 07 July 2018 - 02:44 PM
Hello everyone, today I present to you my 2d noise generation API.
It's grid-based and only really has one function.

API Pastebin: XpmVCuU3

Demo1 Pastebin: ebwe7qjQ

(Second and third demo require the BLittle API and my BufferAPI)
Demo 2 Pastebin: rpLzDPmh
Demo 3 Pastebin: MUSiLETr

BLittle: http://www.computerc...76-blittle-api/
BufferAPI: http://www.computerc...343-buffer-api/

You have my permission to include this API in any of your projects. =)

"Documentation":

noise.createNoise(size, x, y, seed, [smoothness])
-- parameters:
-- size: the size of the noise you want, a power of 2
-- x: the x-coordinate of the chunk you want to get
-- y: the y-coordinate of the chunk you want to get
-- seed: the seed to use when generating the noise
-- [smoothness]: (optional) default is 1, minimum is 0. The maximum for this variable depends on the size of the noise you want to generate

-- returns:
-- noise: a two-dimensional table filled with values from 0 to 1

Video explanation:
[media]http://youtu.be/-gLkAdeJuO0[/media]
Edited on 09 July 2018 - 09:18 PM
InDieTasten #2
Posted 07 July 2018 - 02:52 PM
Pretty nice stuff! I like it :D/>
Xelostar #3
Posted 07 July 2018 - 03:01 PM
Pretty nice stuff! I like it :D/>
Thanks! Let's hope it'll be useful to someone one day. =P