iOS アプリ ウィンドウの上部のナビゲーション バーと下部のツールバーの間に GLKView (OpenGL ES2.0) があります。UIPinchGestureRecognizer を使用してピンチ ズームを実装しましたが、かなりズームアウトすると、ビューが上部のナビゲーション バーを超えて表示されます。驚いたことに、ビューは下部のツールバーを超えていません。私が間違っているのだろうか。
私が使用しているビューポート設定は次のとおりです。
glViewport(0, 0, self.frame.size.width, self.frame.size.height);
更新とピンチ ハンドラは次のとおりです。
-(void) update {
float aspect = fabsf(self.bounds.size.width / self.bounds.size.height);
GLKMatrix4 projectionMatrix = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(65.0f),aspect, 0.01f, 10.0f);
self.effect.transform.projectionMatrix = projectionMatrix;
GLKMatrix4 modelViewMatrix = GLKMatrix4MakeTranslation(0.0f, 0.0f, -6.0f);
modelViewMatrix = GLKMatrix4Multiply(modelViewMatrix, _rotMatrix);
self.effect.transform.modelviewMatrix = modelViewMatrix;
}
-(IBAction) handlePinch: (UIPinchGestureRecognizer *)recognizer {
recognizer.view.transform = CGAffineTransformScale(recognizer.view.transform, recognizer.scale, recognizer.scale);
recognizer.scale = 1.0;
}