简体   繁体   中英

Using 1D Perlin Noise to Generate 2D Terrain

Alright, so I'm working with Swift, and I have GameKit's GKNoise class which allows me to get a noise value given an input. If you graph it you get that standard perlin noise mountain. What I need to do is create a second perlin noise function that takes 3 inputs instead of one. I tried multiplying the inputs, and outputs, but none of them matched up the way the regular 2D cloud looked.

What I'm given (pseudo code)

var value = noise(input)

What I need

var value = customNoise([input1, input2])

What I've tried

var value = noise(input1) * noise(input2)
var value = noise(input1 * input2)
var value = noise(input1 + input2)
// etc

All I need is a way to combine noise, but multiplying it creates weird checkered patters I dislike

I ended up just using GKNoiseMap for this and it worked great, although I did have to shift some code to work with the limited playing field.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM