具有 8 个网格球体的 3D 球形地形。网格的边缘很明显,我不知道为什么
我正在使用 Unity3D,但我的问题是 3D 网格。我希望这里有人可以帮助我或为我指明正确的方向。
我有 2 个版本的代码, http://www.pasteit4me.com/695002 (旧)和http://www.pasteit4me.com/690003(新)。旧代码创建一个网格球体并在其上创建地形。新代码创建了一个 8 网格球体并在其上创建了地形。
在新版本中,可以明显看到网格的边缘,我不知道为什么。看起来边缘没有调整太多,几乎比应有的调整了2-3倍。旧代码中的GenerateB() 和新代码中的Generate() 创建球体。 MakeTerrain() 都创建地形。
如果我不运行 MakeTerrain() 函数,新球体看起来像一个实体网格。我不确定从哪里开始在新代码中的 MakeTerrain() 函数中查找来解决问题:-/
有什么想法吗?
该问题的图像位于 http://img28.imageshack.us/img28/3784 /screenshot20100611at850.png。
I'm working in Unity3D, but my issue is with 3D meshes. I'm hoping someone here can help or point me in the right direction.
I have 2 version of code, http://www.pasteit4me.com/695002 (old) and http://www.pasteit4me.com/690003 (new). The old code, makes a single mesh sphere and creates a terrain on it. The new code makes an 8 mesh sphere and creates a terrain on it.
On the new version the edges of the meshes are obviously seen and I'm not sure why. It looks like the edges are adjusted no much, almost 2-3 times more than they should have been. GenerateB() in the old code and Generate() in the new code creates the sphere. MakeTerrain() in both create the terrain.
If I dont run the MakeTerrain() function the new sphere looks like a solid mesh. I'm not sure where to start looking in the MakeTerrain() function in the new code to solve the issue :-/
Any ideas?
An image of the issue is at http://img28.imageshack.us/img28/3784/screenshot20100611at850.png.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
并非所有线段的边缘都具有相同的法线。您必须考虑接缝两侧的三角形才能计算法线。当您仅单独查看每个细分时,您无法做到这一点。
You don't have the same normals along the edges for all of the segments. You have to take into account the triangles on both sides of a seam to calculate the normal. You can't do that when you are only looking at each segment individually.