开发者

How to make a map editor in XNA

开发者 https://www.devze.com 2023-02-20 15:11 出处:网络
I have made a terrain that is generated from a height map file where each pixel (black to white) represent the height of the terrain at the corresponding location.

I have made a terrain that is generated from a height map file where each pixel (black to white) represent the height of the terrain at the corresponding location.

Now, my question is how would one make a map editor for something like that? I can think of two general ways:

1) The map editor modifies the height map file and regenerates the terrain based on that.

2) The map editor directly alters the vertices of the map, and later upon saving process it generates a height map based on those vertices.

Do you have any good tutorials or re开发者_运维百科sources as to how to get either one to work? I have no idea where to begin.


Check out the XNA Terrain Editor by Eric Grossinger.

I've played around with this thing a little bit and it's pretty slick and should, at the very least, give you some ideas if not an out-right solution.


This book: Building XNA games is an excellent reference and has a great overview of how to create your map editor. The only downfall is it's in XNA 2.0 so you would have to do some converting, but the idea remains the same.

0

精彩评论

暂无评论...
验证码 换一张
取 消