提交 96851610 编写于 作者: R roz3x

added tests

上级 be97134d
......@@ -8,7 +8,7 @@ import (
)
func main() {
img := noise.PerlinGenerate(200, 200, 0.2)
f, _ := os.Create("file.png")
img := noise.PerlinGenerate(200, 200, 1)
f, _ := os.Create("output/perlin_freq_1_parrallel.png")
png.Encode(f, img)
}
......@@ -50,10 +50,11 @@ func PerlinGenerate(height, width int, freq float64) *image.RGBA {
//keep these values as such
alpha, beta, n := 2., 2., 3
// serial implimentation
// works well
img := image.NewRGBA(image.Rect(0, 0, width, height))
p := perlin.NewPerlin(alpha, beta, n, rand.Int63())
// serial implimentation
// works well
for x := 0.; x < float64(height); x++ {
for y := 0.; y < float64(width); y++ {
t := p.Noise2D((x/10)*freq, (y/10)*freq)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册