예제 #1
0
파일: rndtest.go 프로젝트: PieterD/WorldGen
func main() {
	rnd := noise.NewRnd()
	rnd.Seed6()
	rnd.AutoSeed(true)
	io.Copy(os.Stdout, rnd)
	return
}
예제 #2
0
func NewWorld(focus uint32, octaves int) (w *World) {
	w = new(World)
	w.Focus = float64(focus)
	w.rnd = noise.NewRnd()
	w.rnd.Seed6()
	w.nm = noise.NewNoiseMap(w.rnd, focus, octaves, 0.90, true)
	/*
		w.t = noise.NewTranslate(float64(size), float64(size))
		w.t.Zoom(0,0, 1,1)
	*/

	w.tm = noise.NewNoiseMap(w.rnd, 17, 3, 0.5, false)
	return
}
예제 #3
0
파일: server.go 프로젝트: PieterD/WorldGen
func main() {
	flag.Parse()

	if *testrnd {
		rand.Seed(time.Now().UnixNano())
		rnd := noise.NewRnd()
		rnd.Seed6()
		rnd.AutoSeed(true)
		io.Copy(os.Stdout, rnd)
		return
	}

	http.HandleFunc("/dynamic/worldgen.png", handle)

	err := http.ListenAndServe(*listen, nil)
	if err != nil {
		log.Fatal("ListenAndServe: ", err.Error())
	}
}