使钻石广场分形算法无限 [英] Making the diamond square fractal algorithm infinite

查看:166
本文介绍了使钻石广场分形算法无限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想产生无限的地图,这样。我这样做在Python,和我不能得到噪声库正常工作(他们似乎没有能找到我的VS2010,而且做起来原始的Pyt​​hon是太慢)。因此,我试图使用钻石广场算法

I'm trying to generate an infinite map, as such. I'm doing this in Python, and I can't get the noise libraries to correctly work (they don't seem to ever find my VS2010, and doing it in raw Python would be way too slow). As such, I'm trying to use the Diamond-Square Algorithm.

是否有可能以某种方式,使这个技术上的无限?

Would it be possible, in some way, to make this technically infinite?

如果不是,我应该只是回去试图获得的Python的噪音绑定一个工作?

If not, should I just go back to attempting to get one of the Python noise bindings to work?

推荐答案

这是可以做到。瓜分你的风景变成砖,并应用中点位移算法(如我preFER称呼它),每个区块内。

This can be done. Divide up your landscape into "tiles", and apply the midpoint displacement algorithm (as I prefer to call it) within each tile.

每个瓷砖必须足够大,以使高度在一个角不显著依赖于另一个的高度。通过这种方式,你可以创建和销毁砖上飞,设置高度为新出现的角落,以一个独立的随机值。

Each tile must be big enough so that the height at one corner does not significantly depend on the height in another. In that way, you can create and destroy tiles on the fly, setting the height at newly appearing corners to an independent random value.

该值(和瓷砖,以及内部的随机性)必须从瓷砖的位置接种,这样你每次都得到相同的瓷砖。

That value (and the randomness within the tile as well) must be seeded from the tile's position, so that you get the same tile each time.

这篇关于使钻石广场分形算法无限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆