Generating random terrain in Blender3D

天大地大妈咪最大 提交于 2019-12-20 01:04:11

问题


I tried finding a python script in google that will generate a random terrain when the game starts (or each time a the player advances to a new scene) but all the tools I found are for creating a terrain to render it, not for the game mode.

Any idea how/where to find one?

(I'm assuming that since Blender3D has game programming capabilities, it is OK for someone to ask in SO)


回答1:


Is this link related?

http://blenderartists.org/forum/showthread.php?t=77794

To generate terrain (height map) the algorithm is pretty simple (fractal plasma), something like this algorithm (Java):

http://www.sinc.stonybrook.edu/stu/jseyster/plasma/

If you Google search for "fractal plasma python" you might find some example code.




回答2:


I've not really worked much with the game engine, but how about generating a random cloud texture and using that to displace the model? Wouldn't that be easier?




回答3:


You should be able to reprogram most of the python scripts available to generate terrain for rendering to generate terrain for your game... is there a specific thing you need from the script to make it suitable for realtime gameplay instead of a static render?




回答4:


Simplest way to achieve this is to cheat a little. Instead of actually generating random terrain make a random cloud texture (not sure how to do that with phyton) and then make the displace modifier use that texture and that's it! I'm not sure how easier it could be.



来源:https://stackoverflow.com/questions/31834/generating-random-terrain-in-blender3d

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!