我在尝试将我的场景与天空盒包装在平截头体透视中时遇到了一些麻烦。
GLKMatrix4 projectionMatrix = GLKMatrix4MakeFrustum(-50, 50, -50, 50, 0.1, 100);
GLKMatrix4 baseModelViewMatrix = GLKMatrix4MakeTranslation(0.0f, -0.8f, 0.0);
baseModelViewMatrix = GLKMatrix4Scale(baseModelViewMatrix, 0.5f, 0.5f, 0.5f);
self.effect.transform.projectionMatrix = projectionMatrix;
self.effect.transform.modelviewMatrix = GLKMatrix4Multiply(camera, baseModelViewMatrix);
GLKMatrix4 camera = GLKMatrix4MakeLookAt(
self.cameraEye.x,
self.cameraEye.y,
self.cameraEye.z,
0.0,
0.0,
0.0,
0, 1, 0);
self.effect.transform.modelviewMatrix = GLKMatrix4Multiply(camera, baseModelViewMatrix);
self.skyBoxEffect.center = self.cameraEye;
self.skyBoxEffect.transform.projectionMatrix = self.effect.transform.projectionMatrix;
self.skyBoxEffect.transform.modelviewMatrix = self.effect.transform.modelviewMatrix;
我在场景中渲染的对象在感觉或深度上看起来都不错,但是天空盒根本无法正常工作,图像失真可能是由于截锥体透视。这里有什么诀窍吗?如何使用 GLKit 使用平截头体视角制作天空盒?谢谢!