I m 撰写空间探索申请。 我先决定轻年是这些单位,并准确模拟星之间的距离。 tin缩和大量艰苦的工作(主要是学习pes) 我从穿过宇宙的饥饿探测器的角度来看,穿过照相机。
起初,在我从事行星目标工作之前,我没有注意红树脂(zNear)参数。 由于我的规模是轻年,我很快认识到,由于zNear是1.0f 我无法看到这些物体。 经过试验,我得出了这些数字:
#define POV 45
#define zNear 0.0000001f
#define zFar 100000000.0f
gluPerspective (POV, WinWidth/WinHeight, zNear ,zFar);
这样做非常好,因为我能够巡航我的太阳系统(0,0层),并靠近位于高纬度和图形的地球。 然而,其他系统(不是0,0级)更难通过巡航,因为物体以不同寻常的方式从照相移。
然而,我注意到,在穿透宇宙时,开始出现奇怪的视像。 如果我把180度的Y方向推到他们原来的位置,那么我后面的物体就将总结并展示出来。 因此,在通过空间进行饱和时,大多数星体都是正确松散的,但有些星上和行走方向相反(令人不安的是最少)。
通过将zNear改变为0.1f,立即纠正所有这些冰川(但同时也赢得了太阳系目标)。 因此,我 m。 我也尝试与冰川合作,结果完全相同。
我以以下方式看待世界:
glTranslatef(pos_x, pos_y, pos_z);
有了相关的照相机码,可以按要求进行定位。 甚至破碎的照相机功能也没有任何变化。 我甚至尝试了格卢克(LookAt)并再次得出同样的结果。
使用极端的zNear /zFar 值时,是否会有限制? 我试图缩小范围,但徒劳无益。 我甚至把我们的世界单位从轻年改为千米,扩大一切,使用更大的zNear值——无。 HELP!