diff --git a/SGPlayer/Classes/Core/SGVR/SGVRProjection.m b/SGPlayer/Classes/Core/SGVR/SGVRProjection.m index 05d1cbfb..bda4d8f7 100644 --- a/SGPlayer/Classes/Core/SGVR/SGVRProjection.m +++ b/SGPlayer/Classes/Core/SGVR/SGVRProjection.m @@ -94,11 +94,18 @@ - (BOOL)matrixWithAspect:(Float64)aspect matrix1:(GLKMatrix4 *)matrix1 modelMatrix = GLKMatrix4Multiply(modelMatrix, self.sensor.matrix); } #endif + // model modelMatrix = GLKMatrix4RotateY(modelMatrix, GLKMathDegreesToRadians(self.viewport.x) * (self.viewport.flipX ? -1 : 1)); - GLKMatrix4 viewMatrix = GLKMatrix4MakeLookAt(0, 0, 0.0, 0, 0, -1000, 0, 1, 0); - GLKMatrix4 projectionMatrix = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(self.viewport.degress), aspect, 0.1f, 400.0f); + + // view + GLKMatrix4 viewMatrix = GLKMatrix4MakeLookAt(0, 0, 0, 0, 0, -1000, 0, 1, 0); + + // projection + GLKMatrix4 projectionMatrix = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(90), aspect, 0.1f, 400.0f); + GLKMatrix4 modelViewProjectionMatrix = GLKMatrix4Multiply(projectionMatrix, viewMatrix); modelViewProjectionMatrix = GLKMatrix4Multiply(modelViewProjectionMatrix, modelMatrix); + *matrix1 = modelViewProjectionMatrix; self.lastMatrix1Available = YES; self.lastMatrix11 = modelViewProjectionMatrix;