从高度图渲染的地形的大小
我对 XNA 还很陌生,所以如果我问了一个“愚蠢”的问题但我找不到答案,请原谅我。
我对从高度图渲染的地形有一个问题:我得到的地形太小,我的游戏需要更大的东西,但我想保持高度数据更新 - 所以我可以稍后检查碰撞。 (高度数据是一个二维数组,它保存每个点的高度 - 在我的程序中它被称为“dateInaltime”)。
问题是,如果我修改地形的比例,碰撞检查器将使用旧值(来自原始/小地形),因此我会得到错误的碰撞点。
我的地形类看起来像这个。
如何使地形更大,同时扩展高度数据数组?
I'm quite new to XNA so excuse me if I ask a 'silly' question but I couldn't find an answer.
I have a problem with the terrain rendered from a heightmap: the terrain I get is too small, I need something larger for my game but I'd like to keep the heigh tdata updated - so I can check for collisions later. (height data being a 2 dimensional array which holds the heights of each point - in my program it's called 'dateInaltime').
The problem is that if I modify the scale of the terrain, the collision checker will use the old values (from the original/small terrain) so I'll get wrong collision points.
My terrain class looks like this.
How can I make the terrain larger but also extend the height data array?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将此部分更改
为:
它应该按 10 的比例(或您选择的任何数字)分隔顶点。
Change this part:
to:
It should separate the vertices by a scale of 10 (or whatever number you choose).